diff options
Diffstat (limited to 'Include/cpython/pymem.h')
-rw-r--r-- | Include/cpython/pymem.h | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/Include/cpython/pymem.h b/Include/cpython/pymem.h index bd66506639a..79f063b1217 100644 --- a/Include/cpython/pymem.h +++ b/Include/cpython/pymem.h @@ -11,12 +11,8 @@ PyAPI_FUNC(void *) PyMem_RawCalloc(size_t nelem, size_t elsize); PyAPI_FUNC(void *) PyMem_RawRealloc(void *ptr, size_t new_size); PyAPI_FUNC(void) PyMem_RawFree(void *ptr); -/* Configure the Python memory allocators. Pass NULL to use default - allocators. */ -PyAPI_FUNC(int) _PyMem_SetupAllocators(const char *opt); - /* Try to get the allocators name set by _PyMem_SetupAllocators(). */ -PyAPI_FUNC(const char*) _PyMem_GetAllocatorsName(void); +PyAPI_FUNC(const char*) _PyMem_GetCurrentAllocatorName(void); PyAPI_FUNC(void *) PyMem_Calloc(size_t nelem, size_t elsize); @@ -41,6 +37,19 @@ typedef enum { PYMEM_DOMAIN_OBJ } PyMemAllocatorDomain; +typedef enum { + PYMEM_ALLOCATOR_NOT_SET = 0, + PYMEM_ALLOCATOR_DEFAULT = 1, + PYMEM_ALLOCATOR_DEBUG = 2, + PYMEM_ALLOCATOR_MALLOC = 3, + PYMEM_ALLOCATOR_MALLOC_DEBUG = 4, +#ifdef WITH_PYMALLOC + PYMEM_ALLOCATOR_PYMALLOC = 5, + PYMEM_ALLOCATOR_PYMALLOC_DEBUG = 6, +#endif +} PyMemAllocatorName; + + typedef struct { /* user context passed as the first argument to the 4 functions */ void *ctx; |