Tcl_Alloc

Difference between version 5 and 6 - Previous - Next
Allocate memory using the Tcl library's memory allocation engine. Like `malloc`, but integrates with the [memory] command (if that's defined). Pairs up with [Tcl_Realloc] and [Tcl_Free].

'''`Tcl_Alloc`''' and '''`Tcl_Realloc`''' ''guarantee'' to always return a valid block of memory; they will '''panic''' (call [Tcl_Panic]) if memory allocation fails.  For alternatives that return ''`NULL`'', use '''`Tcl_AttemptAlloc`''' and '''`Tcl_AttemptRealloc`'''.


See also the '''[http://www.tcl.tk/man/tcl/TclLib/Alloc.htm%|%manual]'''.
(Note: the manual does not mention Tcl_Panic)

<<categories>>Tcl C API