Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fbb556d

Browse files
committed
Arrange to export the _PyMalloc_{Malloc, Realloc, Free} entry points. On
Windows some modules are considered (by me, and I don't care what anyone else thinks about this <wink>) to be part of "the core" despite that they happen to be compiled into separate DLLs (the "to DLL or not to DLL?" question on Windows is nearly arbitrary). Making the pymalloc entry points available to them allows the Windows build to complete without incident when WITH_PYMALLOC is #define'd. Note that this isn't unprecedented. Other "private API" functions we export include _PySequence_IterSearch, _PyEval_SliceIndex, _PyCodec_Lookup, _Py_ZeroStruct, _Py_TrueStruct, _PyLong_New and _PyModule_Clear.
1 parent c63a396 commit fbb556d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Include/pymem.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ extern DL_IMPORT(void) PyMem_Free(void *);
9292

9393
/* pymalloc (private to the interpreter) */
9494
#ifdef WITH_PYMALLOC
95-
void *_PyMalloc_Malloc(size_t nbytes);
96-
void *_PyMalloc_Realloc(void *p, size_t nbytes);
97-
void _PyMalloc_Free(void *p);
95+
DL_IMPORT(void *) _PyMalloc_Malloc(size_t nbytes);
96+
DL_IMPORT(void *) _PyMalloc_Realloc(void *p, size_t nbytes);
97+
DL_IMPORT(void) _PyMalloc_Free(void *p);
9898
#define _PyMalloc_MALLOC _PyMalloc_Malloc
9999
#define _PyMalloc_REALLOC _PyMalloc_Realloc
100100
#define _PyMalloc_FREE _PyMalloc_Free

0 commit comments

Comments
 (0)