[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
HEAP Heap and Stack Utilization pp 225
Define: The Stack and Heap are memory areas outside the Code and Data
segments. They are maintained by the run-time code.
Purpose: The Heap is used to store dynamic variables.
The Stack is is used to store local variables, intermediate
results during evaluation of expressions, and as a means to
pass parameters to and from functions and procedures.
Notes: During execution of a Turbo program a Code segment, Data segment
and Stack segment are allocated for the program.
The Stack segment can be much larger than 64k, as it encompasses
the remainder of free memory not used by the Code & Data segments.
At program startup, the heap pointer HeapPtr is set to low
memory in the Stack segment. The heap grows Upward in memory.
The stack pointer is set to the highest address in the stack
segment at program startup. The stack grows Downward in memory.
The stack and heap can collide, resulting in system lockup if
collision checking {$K-} is passive.
See Also:
GetMem
HeapPtr
MaxAvail
New
Pointer
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson