summaryrefslogtreecommitdiffstats
path: root/Include/objimpl.h
diff options
context:
space:
mode:
authorNeil Schemenauer <nascheme@enme.ucalgary.ca>2002-03-18 18:13:41 (GMT)
committerNeil Schemenauer <nascheme@enme.ucalgary.ca>2002-03-18 18:13:41 (GMT)
commit11f5be8d88c94935cd584f5816adec3a76309e20 (patch)
treea4192a8c3ab4af4ce34cebd493021b2e8c5533a6 /Include/objimpl.h
parentf6eafc3fe16662c4d40c3f8ce3283a9d309c5023 (diff)
downloadcpython-11f5be8d88c94935cd584f5816adec3a76309e20.zip
cpython-11f5be8d88c94935cd584f5816adec3a76309e20.tar.gz
cpython-11f5be8d88c94935cd584f5816adec3a76309e20.tar.bz2
Simpilify PyCore_* macros by assuming the function prototypes for
malloc() and free() don't change.
Diffstat (limited to 'Include/objimpl.h')
-rw-r--r--Include/objimpl.h38
1 files changed, 9 insertions, 29 deletions
diff --git a/Include/objimpl.h b/Include/objimpl.h
index a616620..47e0da4 100644
--- a/Include/objimpl.h
+++ b/Include/objimpl.h
@@ -77,40 +77,20 @@ recommended to use PyObject_{New, NewVar, Del}. */
modules should use the PyObject_* API. */
#ifdef WITH_PYMALLOC
-#define PyCore_OBJECT_MALLOC_FUNC _PyCore_ObjectMalloc
-#define PyCore_OBJECT_REALLOC_FUNC _PyCore_ObjectRealloc
-#define PyCore_OBJECT_FREE_FUNC _PyCore_ObjectFree
-#define NEED_TO_DECLARE_OBJECT_MALLOC_AND_FRIEND
+void *_PyCore_ObjectMalloc(size_t nbytes);
+void *_PyCore_ObjectRealloc(void *p, size_t nbytes);
+void _PyCore_ObjectFree(void *p);
+#define PyCore_OBJECT_MALLOC _PyCore_ObjectMalloc
+#define PyCore_OBJECT_REALLOC _PyCore_ObjectRealloc
+#define PyCore_OBJECT_FREE _PyCore_ObjectFree
#endif /* !WITH_PYMALLOC */
-#ifndef PyCore_OBJECT_MALLOC_FUNC
-#undef PyCore_OBJECT_REALLOC_FUNC
-#undef PyCore_OBJECT_FREE_FUNC
-#define PyCore_OBJECT_MALLOC_FUNC PyCore_MALLOC_FUNC
-#define PyCore_OBJECT_REALLOC_FUNC PyCore_REALLOC_FUNC
-#define PyCore_OBJECT_FREE_FUNC PyCore_FREE_FUNC
-#endif
-
-#ifndef PyCore_OBJECT_MALLOC_PROTO
-#undef PyCore_OBJECT_REALLOC_PROTO
-#undef PyCore_OBJECT_FREE_PROTO
-#define PyCore_OBJECT_MALLOC_PROTO PyCore_MALLOC_PROTO
-#define PyCore_OBJECT_REALLOC_PROTO PyCore_REALLOC_PROTO
-#define PyCore_OBJECT_FREE_PROTO PyCore_FREE_PROTO
-#endif
-
-#ifdef NEED_TO_DECLARE_OBJECT_MALLOC_AND_FRIEND
-extern void *PyCore_OBJECT_MALLOC_FUNC PyCore_OBJECT_MALLOC_PROTO;
-extern void *PyCore_OBJECT_REALLOC_FUNC PyCore_OBJECT_REALLOC_PROTO;
-extern void PyCore_OBJECT_FREE_FUNC PyCore_OBJECT_FREE_PROTO;
-#endif
-
#ifndef PyCore_OBJECT_MALLOC
#undef PyCore_OBJECT_REALLOC
#undef PyCore_OBJECT_FREE
-#define PyCore_OBJECT_MALLOC(n) PyCore_OBJECT_MALLOC_FUNC(n)
-#define PyCore_OBJECT_REALLOC(p, n) PyCore_OBJECT_REALLOC_FUNC((p), (n))
-#define PyCore_OBJECT_FREE(p) PyCore_OBJECT_FREE_FUNC(p)
+#define PyCore_OBJECT_MALLOC(n) PyCore_MALLOC(n)
+#define PyCore_OBJECT_REALLOC(p, n) PyCore_REALLOC((p), (n))
+#define PyCore_OBJECT_FREE(p) PyCore_FREE(p)
#endif
/*