diff options
author | dgp <dgp@users.sourceforge.net> | 2012-12-12 05:01:04 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2012-12-12 05:01:04 (GMT) |
commit | 4ff4072eaa5652ad04b711a62839002a865b6358 (patch) | |
tree | 76e9bed3392c20ce14c245bc43f2ec98ceaf0b54 /generic/tcl.h | |
parent | 1f46b14efb4cff5cd99eecd20058ec3d98b283a5 (diff) | |
download | tcl-4ff4072eaa5652ad04b711a62839002a865b6358.zip tcl-4ff4072eaa5652ad04b711a62839002a865b6358.tar.gz tcl-4ff4072eaa5652ad04b711a62839002a865b6358.tar.bz2 |
Rename the memory routines so that Tcl_Alloc/Tcl_Free/etc become the recommendednovem_rename_memory_API
things for extensions and embedders to call, instead of ckalloc/ckfree/etc.
Tcl_Alloc, etc. are macros that can be configured for memory debuggin, as ckalloc, etc.
have been and continue to be.
Diffstat (limited to 'generic/tcl.h')
-rw-r--r-- | generic/tcl.h | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/generic/tcl.h b/generic/tcl.h index 162983b..121ab5c 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -2255,6 +2255,12 @@ TCLAPI void Tcl_GetMemoryInfo(Tcl_DString *dsPtr); * defined in tclCkalloc.c. */ +#define Tcl_Alloc(x) ckalloc(x) +#define Tcl_Free(x) ckfree(x) +#define Tcl_Realloc(x, y) ckrealloc(x, y) +#define Tcl_AttemptAlloc(x) attemptckalloc(x) +#define Tcl_AttemptRealloc(x, y) attemptckrealloc(x, y) + #ifdef TCL_MEM_DEBUG # define ckalloc(x) \ @@ -2271,21 +2277,21 @@ TCLAPI void Tcl_GetMemoryInfo(Tcl_DString *dsPtr); #else /* !TCL_MEM_DEBUG */ /* - * If we are not using the debugging allocator, we should call the Tcl_Alloc, + * If we are not using the debugging allocator, we should call the Tcl_MemAlloc, * et al. routines in order to guarantee that every module is using the same * memory allocator both inside and outside of the Tcl library. */ # define ckalloc(x) \ - ((void *) Tcl_Alloc((unsigned)(x))) + ((void *) Tcl_MemAlloc((unsigned)(x))) # define ckfree(x) \ - Tcl_Free((char *)(x)) + Tcl_MemFree((char *)(x)) # define ckrealloc(x,y) \ - ((void *) Tcl_Realloc((char *)(x), (unsigned)(y))) + ((void *) Tcl_MemRealloc((char *)(x), (unsigned)(y))) # define attemptckalloc(x) \ - ((void *) Tcl_AttemptAlloc((unsigned)(x))) + ((void *) Tcl_AttemptMemAlloc((unsigned)(x))) # define attemptckrealloc(x,y) \ - ((void *) Tcl_AttemptRealloc((char *)(x), (unsigned)(y))) + ((void *) Tcl_AttemptMemRealloc((char *)(x), (unsigned)(y))) # undef Tcl_InitMemory # define Tcl_InitMemory(x) # undef Tcl_DumpActiveMemory |