[Cython] now a malloc/free-based way for tmp memory
Robert Bradshaw
robertwb at math.washington.edu
Wed Apr 30 17:50:52 CEST 2008
On Apr 30, 2008, at 8:38 AM, Lisandro Dalcin wrote:
> Dear all,
>
> After the trick of using a string buffer for obtaining tmp memory and
> let python manage the automatic deallocation, now a pure malloc/free
> based way that does not need even to declare a custom class. It just
> used PyCObject objects created with the pointer to memory (obtained
> with malloc) and a destructor function (calling free). It can be
> easily modified to use memalign if needed.
>
> Any one interested, please comment on the attached pxi file.
>
> --
> Lisandro Dalcín
Thanks, that is nice. The only drawback I see is that it requires two
allocations, rather than one (as is the case with the string trick).
- Robert
More information about the Cython-dev
mailing list