A Divendres 27 Gener 2006 19:26, Russel Howe va escriure: > > Yes. My own tests seems to indicate that you are right. I tend to > > think that numarray.array actually *does* the copy, but the question > > is why a subsequent free on rdata[i].p causes a segfault (?). > > numarray does not copy. I traced the execution and found no place > where copy occurs.
Yes, you are apparently right :-/ > > Well, perhaps it would be worth the effort to have a try and use the > > standard way to get rid of the buffer "a la HDF5", namely, something > > like the call: > > > > H5Dvlen_reclaim(type_id, space_id, xfer_pid, data) > > > > *after* the numarray creation. However, this implies a refactoring of > > the VLArray._readArray in hdf5Extension.pyx because you need to access > > to the space_id and xfer_pid (you already have access to type_id and > > data in Pyrex space). Maybe you want to have a try at this. > > So I modified H5VLARRAYread to return these values, and made an > explicit copy in _readArray, and then called H5Dvlen_reclaim at the > end. No memory leak, no segfault, but I am not sure about the > methods I used. I have attached a patch, what is the correct way to > do this? And your solution passes all the tests in test_vlarray? I'm working on a different implementation (inspired on your patch), but some tests are still giving problems. I've commited the changes to SVN anyway, so if you want to have a look, your suggestions are welcome. SVN: http://pytables.carabos.com/svn/pytables/trunk Cheers, -- >0,0< Francesc Altet http://www.carabos.com/ V V Cárabos Coop. V. Enjoy Data "-" ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642 _______________________________________________ Pytables-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/pytables-users
