Skip to content
Tcl Source Code Changes To Allocation
Login

Changes To Allocation

Changes to "Allocation" between 2014-08-29 15:29:13 and 2014-08-29 15:31:45

︙
57
58
59
60
61
62
63

64






65
57
58
59
60
61
62
63
64

65
66
67
68
69
70
71







+
-
+
+
+
+
+
+


<h1>Discussion</h1>

This module handles dynamic allocation and free of memory.

The largest defect is that <b>Tcl_Alloc</b> takes an <i>unsigned int</i>
argument for the number of bytes to allocate, limiting the allocation size to
4 Gib.  An allocator without such a low limitation must be part of Tcl 9.
4 Gib.

A surprising feature for many is that <b>Tcl_Alloc</b> panics on an 
allocation failure.  The alternative <b>Tcl_AttemptAlloc</b> exists for
those who wish to choose it, but much of Tcl rests on foundations that will
be ripped away in any out-of-memory situation.