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 manual .

(Note: the manual does not mention Tcl_Panic)