]> granicus.if.org Git - python/commitdiff
Arrange to export the _PyMalloc_{Malloc, Realloc, Free} entry points. On
authorTim Peters <tim.peters@gmail.com>
Wed, 20 Mar 2002 04:02:31 +0000 (04:02 +0000)
committerTim Peters <tim.peters@gmail.com>
Wed, 20 Mar 2002 04:02:31 +0000 (04:02 +0000)
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.

Include/pymem.h

index 95922721a168c18f18c539008769ba582239e25e..10e915f3ba646b50c2a8058cf98863638c7fc6bc 100644 (file)
@@ -92,9 +92,9 @@ extern DL_IMPORT(void) PyMem_Free(void *);
        
 /* pymalloc (private to the interpreter) */
 #ifdef WITH_PYMALLOC
-void *_PyMalloc_Malloc(size_t nbytes);
-void *_PyMalloc_Realloc(void *p, size_t nbytes);
-void _PyMalloc_Free(void *p);
+DL_IMPORT(void *) _PyMalloc_Malloc(size_t nbytes);
+DL_IMPORT(void *) _PyMalloc_Realloc(void *p, size_t nbytes);
+DL_IMPORT(void) _PyMalloc_Free(void *p);
 #define _PyMalloc_MALLOC _PyMalloc_Malloc
 #define _PyMalloc_REALLOC _PyMalloc_Realloc
 #define _PyMalloc_FREE _PyMalloc_Free