Memory allocation: Difference between revisions

Content added Content deleted
m (Lang learning cat)
(Expanded description of why Tcl considers this to be an omitted task; it's actually interesting from the perspective of the task.)
Line 242: Line 242:
>>> </lang>
>>> </lang>


==[[Tcl]]==
Generally speaking you do not perform memory allocation directly in Tcl; scripts leave that under the control of the runtime (which manages the heap, threaded object pools and stacks automatically for you) and just work with values of arbitrary size. Indeed, the sizes of entities are not guaranteed in any case; the number of bytes per character or number does vary over time as the runtime selects the most efficient representation for it.

However the [[Machine Address]] task shows how you can do it directly if necessary.
It just happens that it never actually is necessary to directly allocate memory in Tcl scripts in practice.
{{Omit From|Tcl}} <!-- You don't do manual memory allocation in Tcl. -->
{{Omit From|Tcl}} <!-- You don't do manual memory allocation in Tcl. -->