[Pyrex] Just some thoughts

Grant McDonald gmcdonald at infocomp.com
Wed Apr 19 01:54:41 CEST 2006


> 2) I think that Pyrex should offer some low-level memory managment
routines. 
> I think of sizeof operator, as well as the C standard *alloc and free 
> functions. It would be also nice to have something like the g_new macro 
> known from the GLib library.
>
> [snip]

If you read the Pyrex doco you will find that it is preferred to use the
python
memory management routines when allocating memory:

ctypedef long size_t

cdef extern from "Python.h":
    void* PyMem_Malloc(size_t n)
    void PyMem_Free(void* mem)

They also have new and delete analogues if that is preferred. The doco for
these
functions is in the Python documentation in the Python/C API section.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.copyleft.no/pipermail/pyrex/attachments/20060419/65cb37b7/attachment.html


More information about the Pyrex mailing list