From: Konrad H. <hi...@cn...> - 2004-02-25 10:52:55
|
On Tuesday 24 February 2004 22:10, Andrea Riciputi wrote: > anymore. These arrays have been created on the C side of my code and > then copied (actually linked via PyArray_FromDimsAndData) to Numeric > arrays. How can I release these arrays and get back memory in order to > be able to start the next run? I am not aware of any clean way. A hack that might help you out is array->flags |=3D OWN_DATA; The data will then be freed when the array is released. However, there ar= e a=20 few caveats: 1) This is not documented. 2) It works only if the data was allocated by the same memory manager tha= t is used by NumPy. 3) You have to make sure that no other code keeps a reference to the data= =2E If modifying the C code is an option, then it is probably the better one. Konrad. --=20 -------------------------------------------------------------------------= ------ Konrad Hinsen | E-Mail: hi...@cn... Centre de Biophysique Moleculaire (CNRS) | Tel.: +33-2.38.25.56.24 Rue Charles Sadron | Fax: +33-2.38.63.15.17 45071 Orleans Cedex 2 | Deutsch/Esperanto/English/ France | Nederlands/Francais -------------------------------------------------------------------------= ------ |