[Numpy-discussion] Creating PyArrayObject in C++

Lisandro Dalcin dalcinl@gmail....
Tue Jul 7 20:55:33 CDT 2009


2009/7/7 Stéfan van der Walt <stefan@sun.ac.za>:
> Hi Kenny
>
> 2009/7/7 Kenny Abernathy <kenny.abernathy@gmail.com>:
>> I can guarantee that all analysis will be finished before the Unit object is
>> destroyed and delete[] is called, so I don't think that's a problem.
>
> There is a neat trick to make sure things don't get deallocated out of order:
>
> http://blog.enthought.com/?p=62
>

Moreover, if you use PyCObject_FromVoidPtr()
http://docs.python.org/c-api/cobject.html, you can register a
deallocation routine to be called at DECREF time, so no need at all of
implementing your a brand new type.



-- 
Lisandro Dalcín
---------------
Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
PTLC - Güemes 3450, (3000) Santa Fe, Argentina
Tel/Fax: +54-(0)342-451.1594


More information about the NumPy-Discussion mailing list