extern "C" {
#endif
+#ifndef Py_BUILD_CORE
+# error "Py_BUILD_CORE must be defined to include this header"
+#endif
+
#include "objimpl.h"
#include "pymem.h"
#define _PyGC_generation0 _PyRuntime.gc.generation0
+
+/* Set the memory allocator of the specified domain to the default.
+ Save the old allocator into *old_alloc if it's non-NULL.
+ Return on success, or return -1 if the domain is unknown. */
+PyAPI_FUNC(int) _PyMem_SetDefaultAllocator(
+ PyMemAllocatorDomain domain,
+ PyMemAllocatorEx *old_alloc);
+
#ifdef __cplusplus
}
#endif
PyAPI_FUNC(void) PyMem_SetupDebugHooks(void);
#endif /* Py_LIMITED_API */
-#ifdef Py_BUILD_CORE
-/* Set the memory allocator of the specified domain to the default.
- Save the old allocator into *old_alloc if it's non-NULL.
- Return on success, or return -1 if the domain is unknown. */
-PyAPI_FUNC(int) _PyMem_SetDefaultAllocator(
- PyMemAllocatorDomain domain,
- PyMemAllocatorEx *old_alloc);
-#endif
-
-
/* bpo-35053: expose _Py_tracemalloc_config for performance:
_Py_NewReference() needs an efficient check to test if tracemalloc is
tracing.
#include "Python.h"
#include "osdefs.h"
+#include "internal/mem.h"
#include "internal/pygetopt.h"
#include "internal/pystate.h"
#include "Python.h"
+#include "internal/mem.h"
#include <stdbool.h>
#include "Python.h"
+#include "internal/mem.h"
#include "internal/pystate.h"
#include <locale.h>
#ifdef HAVE_LANGINFO_H
#include "Python-ast.h"
#undef Yield /* undefine macro conflicting with winbase.h */
#include "internal/hash.h"
+#include "internal/mem.h"
#include "internal/pystate.h"
#include "errcode.h"
#include "marshal.h"
#include "Python.h"
#include "osdefs.h"
+#include "internal/mem.h"
#include "internal/pystate.h"
#include <wchar.h>
#undef Yield /* undefine macro conflicting with winbase.h */
#include "internal/context.h"
#include "internal/hamt.h"
+#include "internal/mem.h"
#include "internal/pystate.h"
#include "grammar.h"
#include "node.h"
/* Thread and interpreter state structures and their interfaces */
#include "Python.h"
+#include "internal/mem.h"
#include "internal/pystate.h"
#define _PyThreadState_SET(value) \
*/
#include "Python.h"
+#include "internal/mem.h"
#include "internal/pystate.h"
#include "code.h"
#include "frameobject.h"