Version 0 of ckalloc

Updated 2008-07-23 10:51:44 by lars_h

ckalloc is what most C-level users of the Tcl C API use to allocate blocks of memory.

This is a C preprocessor macro which usually expands to Tcl_Alloc, but the compile-time flag TCL_MEM_DEBUG can make it expand to a Tcl_DbCkalloc call instead. The purpose of this is to support memory debugging: no change of source files is needed to turn debugging on.

http://www.tcl.tk/man/tcl8.5/TclLib/Alloc.htm

So: If you're new to C, think Tcl_Alloc, but write ckalloc in case you'll sometime in the future need to debug memory allocation in your code.

Question: Is it a problem if some extensions being used are compiled with TCL_MEM_DEBUG and others are compiled without it?

See also: