65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
+
+
+
+
+
+
+
|
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.
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.
Many coders behave as if the performance of these memory allocators is
a burden to be avoided. The pooling system for <b>Tcl_Obj</b>, and the whole
<b>TclStack*</b> scheme of stack-patterned allocation are indications that
significant lengths are gone to in order to avoid calls to <b>Tcl_Alloc</b>.
An allocation system that behaved acceptably well in the first place might lead
to a great deal of code simplification.
As it currently exists, this is not so much a module as it is a collection of
alternative modules. There are at least 3 allocation systems here, and each
one may be overlaid with memory debugging facilities. The combination you
get in <b>Tcl_Alloc</b> is controlled by a set of compiler directives
at the time the <b>Tcl_Alloc</b> is compiled. This leads to a significant
problem that not all configurations are mutually compatible. This means
|