diff options
author | Guido van Rossum <guido@python.org> | 1995-01-12 11:45:45 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1995-01-12 11:45:45 (GMT) |
commit | caa63808861d4e92d4dc1005fc01de0f2e4a8fd0 (patch) | |
tree | 3771531169ab510aca9b69cdc4d9de2b5c8810c4 /Include/mymalloc.h | |
parent | 94390ec2a6ea5acbea9dead528ce067c396a0301 (diff) | |
download | cpython-caa63808861d4e92d4dc1005fc01de0f2e4a8fd0.zip cpython-caa63808861d4e92d4dc1005fc01de0f2e4a8fd0.tar.gz cpython-caa63808861d4e92d4dc1005fc01de0f2e4a8fd0.tar.bz2 |
The great renaming, phase two: all header files have been updated to
use the new names exclusively, and the linker will see the new names.
Files that import "Python.h" also only see the new names. Files that
import "allobjects.h" will continue to be able to use the old names,
due to the inclusion (in allobjects.h) of "rename2.h".
Diffstat (limited to 'Include/mymalloc.h')
-rw-r--r-- | Include/mymalloc.h | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/Include/mymalloc.h b/Include/mymalloc.h index 3c80db1..f7c0ae8 100644 --- a/Include/mymalloc.h +++ b/Include/mymalloc.h @@ -57,10 +57,10 @@ extern "C" { #endif #ifndef HAVE_STDLIB_H -extern ANY *malloc PROTO((size_t)); -extern ANY *calloc PROTO((size_t, size_t)); -extern ANY *realloc PROTO((ANY *, size_t)); -extern void free PROTO((ANY *)); /* XXX sometimes int on Unix old systems */ +extern ANY *malloc Py_PROTO((size_t)); +extern ANY *calloc Py_PROTO((size_t, size_t)); +extern ANY *realloc Py_PROTO((ANY *, size_t)); +extern void free Py_PROTO((ANY *)); /* XXX sometimes int on Unix old systems */ #endif /* !HAVE_STDLIB */ #ifndef NULL @@ -69,16 +69,20 @@ extern void free PROTO((ANY *)); /* XXX sometimes int on Unix old systems */ /* XXX Always allocate one extra byte, since some malloc's return NULL XXX for malloc(0) or realloc(p, 0). */ -#define NEW(type, n) ( (type *) malloc(1 + (n) * sizeof(type)) ) -#define RESIZE(p, type, n) \ +#define PyMem_NEW(type, n) ( (type *) malloc(1 + (n) * sizeof(type)) ) +#define PyMem_RESIZE(p, type, n) \ if ((p) == NULL) \ (p) = (type *) malloc(1 + (n) * sizeof(type)); \ else \ (p) = (type *) realloc((ANY *)(p), 1 + (n) * sizeof(type)) -#define DEL(p) free((ANY *)p) -#define XDEL(p) if ((p) == NULL) ; else DEL(p) +#define PyMem_DEL(p) free((ANY *)p) +#define PyMem_XDEL(p) if ((p) == NULL) ; else PyMem_DEL(p) #ifdef __cplusplus } #endif + +#ifndef Py_USE_NEW_NAMES +#include "rename2.h" +#endif #endif /* !Py_MYMALLOC_H */ |