|
From: <usr...@pr...> - 2005-10-07 12:52:40
|
Hi all, I'm using the numarray package. I would like to use the numarray C API to create a new array object and fill it with data without copying. Also, I would like numarray to take care of freeing the data once the numarray object is destructed. I've managed to find some related posts in the mailing list archive, but it is really unclear which of these posts are still accurate and what the current 'recommended' approach is. See: http://sourceforge.net/mailarchive/message.php?msg_id=11788304 http://sourceforge.net/mailarchive/message.php?msg_id=2494535 Currently, I first create a new PyArrayObject that is large enough to hold the data: array = NA_vNewArray(NULL,__numarray_type,tmp_num_dims,tmp_dims); then I pass array->data to a C function that reads the data from disk. Any comments on this approach? Also, I was wondering if numarray frees the data using this approach (because it also allocates the memory in the first place within the NA_vNewArray function.) Thanks, Joris van Zwieten |