jfitz
Junior Member
 
USA
345 Posts |
Posted - 01 August 2003 : 16:53:05
|
There are two sets of definitions for each that you will need to keep in mind.
I. Both stacks and heaps are specific types of memory structures used in data structure design. They are frequently implemented and manipulated as objects within a program.
II. From an operating system and program execution perspective (this is a WinTel-centric discussion), the combination of stack and heap represent the free memory available to your executing program. The stack is used for return address storage, parameter passing and allocation of temporary variables during function calls as your program executes. The heap is used for data structure and object allocation during run-time. The stack and the heap grow towards each other during program execution and when they collide, you are out of memory.
Check any computer science book on parameter passing or calling conventions. The later editions of Delphi have dropped this level of memory management discussion from their printed documentation, but if you can get hold of the Delphi 3 Object Pascal Language Guide, there are a couple of chapters (18 and 19) that give a pretty good overview of the topic. |
--Jördan It's a wasted day if you don't spend at least part of it flying upside down. |
 |
|