diff options
author | Thouis (Ray) Jones <thouis@gmail.com> | 2012-05-25 09:59:43 +0200 |
---|---|---|
committer | Thouis (Ray) Jones <thouis@gmail.com> | 2012-06-15 13:55:40 +0200 |
commit | be294ab42bc51c7588e9ed50982046c03f00f618 (patch) | |
tree | cd60703c39ce6389acc6e80789ca8c6c8a1e0651 /numpy/oldnumeric/compat.py | |
parent | 6fe584f1d2775d96fa68ccb4707ba0f658e85376 (diff) | |
download | numpy-be294ab42bc51c7588e9ed50982046c03f00f618.tar.gz |
ENH: expose PyDataMem_NEW/FREE/RENEW as numpy API functions with an event hook.
Moves PyDataMem_NEW/FREE/RENEW to the external API.
Fixes PyDataMem_NEW/RENEW to return void* instead of char*.
Replaces PyDataMem_NEW/FREE with NpySortArray_malloc/free in sort.c.src
(should be reverted if npysort is moved to be part of multiarraymodule).
Adds PyDataMem_SetEventHook which takes a (PyDataMem_EventHookFunc *) as an argument,
with signature:
void hook(void *old, void *new, size_t size).
When not NULL, hook will be called at the end of each PyDataMem_NEW/FREE/RENEW:
result = PyDataMem_NEW(size) -> (*hook(NULL, result, size)
PyDataMem_FREE(ptr) -> (*hook(ptr, NULL, 0)
result = PyDataMem_RENEW(ptr, size) -> (*hook)(ptr, result, size)
Adds tests in multiarray_tests.c.src, driven by tests/test_multiarray.py.
Diffstat (limited to 'numpy/oldnumeric/compat.py')
0 files changed, 0 insertions, 0 deletions