Skip to content

Commit

Permalink
fixup! Optimization: Avoid API calls for allocator usages
Browse files Browse the repository at this point in the history
  • Loading branch information
kayhayen committed May 15, 2024
1 parent 6cfee0c commit 3cd5478
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions nuitka/build/include/nuitka/allocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,13 @@ extern void *python_mem_ctx;
extern void initNuitkaAllocators(void);

// Our version of "PyObject_Malloc".
NUITKA_MAY_BE_UNUSED static PyObject *NuitkaObject_Malloc(size_t size) {
return python_obj_malloc(python_obj_ctx, size);
}
NUITKA_MAY_BE_UNUSED static void *NuitkaObject_Malloc(size_t size) { return python_obj_malloc(python_obj_ctx, size); }

// Our version of "PyMem_Malloc".
NUITKA_MAY_BE_UNUSED static PyObject *NuitkaMem_Malloc(size_t size) { return python_mem_malloc(python_mem_ctx, size); }
NUITKA_MAY_BE_UNUSED static void *NuitkaMem_Malloc(size_t size) { return python_mem_malloc(python_mem_ctx, size); }

// Our version of "PyMem_Calloc".
NUITKA_MAY_BE_UNUSED static PyObject *NuitkaMem_Calloc(size_t nelem, size_t elsize) {
NUITKA_MAY_BE_UNUSED static void *NuitkaMem_Calloc(size_t nelem, size_t elsize) {
return python_mem_calloc(python_mem_ctx, nelem, elsize);
}

Expand Down

0 comments on commit 3cd5478

Please sign in to comment.