[issue21233] Add *Calloc functions to CPython memory allocation API

STINNER Victor report at bugs.python.org
Wed Apr 16 04:49:46 CEST 2014


STINNER Victor added the comment:

In numpy, I found the two following functions:


/*NUMPY_API
 * Allocates memory for array data.
 */
void* PyDataMem_NEW(size_t size);

/*NUMPY_API
 * Allocates zeroed memory for array data.
 */
void* PyDataMem_NEW_ZEROED(size_t size, size_t elsize);

So it looks like it needs two size_t parameters. Prototype of the C function calloc():

void *calloc(size_t nmemb, size_t size);

I agree that it's better to provide the same prototype than calloc().

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21233>
_______________________________________


More information about the Python-bugs-list mailing list