Manage memory allocation calls in Cython code efficiently.
Manage calls to calloc/free through Cython
$ pip install cymem$ from cymem.mpool cimport Pool
cdef Pool mem = Pool()
cdef void* ptr = mem.alloc(100, sizeof(char))$ from cymem.mpool cimport Pool
cdef Pool pool = Pool()
cdef char* buffer = <char*>pool.alloc(1024, sizeof(char))$ cdef Pool mem = Pool()
mem.free(ptr)
del mem$ python -c "import cymem; print(cymem.__version__)"