Path: utzoo!attcan!uunet!wuarchive!decwrl!shelby!portia!dhinds From: dhinds@portia.Stanford.EDU (David Hinds) Newsgroups: comp.lang.pascal Subject: Re: TP Dynamic variable disposal Summary: Memory allocation in TP v3.0 vs 4.0, etc Message-ID: <6979@portia.Stanford.EDU> Date: 24 Nov 89 20:02:46 GMT References: <21510@adm.BRL.MIL> <4620@ncsuvx.ncsu.edu> <6957@portia.Stanford.EDU> <4645@ncsuvx.ncsu.edu> Sender: David Hinds Organization: Stanford University Lines: 19 In article <4645@ncsuvx.ncsu.edu>, unkydave@shumv1.uucp (David Bank) writes: > > It was my understanding, and it may be in error, that dynamic memory > allocation handling underwent significant alteration between versions > 3.0 and 4.0 (along with just about everything else). > My description applies to all versions of TP, as far as I know. I don't remember for sure, but I think the early TP dispose() routine wasn't capable of reclaiming the disposed space for later calls to new(). The newer versions maintain a list of free blocks of memory within the heap. Heap variables are created starting at the base of the heap, and the free list grows downward from the top. The early versions (3.0 or earlier?) didn't maintain a free list. The DOS-level memory allocation is basically the same in all versions. In fact, for early versions of DOS, the "dispose block" routine never worked right, and it would have been disasterous for TP to use it for heap memory management. David Hinds dhinds@portia.stanford.edu