[Numpy-discussion] Where to put misc C function in numpy ?

David Cournapeau cournape at gmail.com
Thu Aug 9 11:00:21 EDT 2007


Hi,

Following the thread on facilities for SIMD friendly allocations, I
have a basic private branch ready for review, but I have one problem:
where to put the allocation functions ? The problem is the following:
data buffers are allocated/deallocated with functions defined in
ndarrayobject,h

PyMemData_NEW(ptr) malloc(ptr)
...

Which I would replace with

PyMemData_NEW(ptr) npy_aligned_alloc(ptr, DEF_ALIGNMENT)

Where to define npy_aligned_alloc ? As PyMemData_NEW is used outside
numpy.core, the function needs to be available somewhat "publically",
but as far as I understand numpy code structure, there is no such
facility available (eg a pure C library, totally unaware of python,
which would contain some useful tools for numpy), right ?

David



More information about the NumPy-Discussion mailing list