Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!ut-emx!boerner From: boerner@ut-emx.uucp (Brendan B. Boerner) Newsgroups: comp.lang.pascal Subject: Re: (R)Re: Quick Directories/Better Sorts Message-ID: <40124@ut-emx.uucp> Date: 24 Nov 90 22:06:10 GMT References: <25082@adm.brl.mil> Organization: UT Austin Computation Center, Microcomputer Technologies Lines: 36 In article <25082@adm.brl.mil> CDCKAB%EMUVM1.BITNET@cunyvm.cuny.edu ( Karl Brendel) writes: [...] >Unfortunately, if > > Array[1..5000]of index > >gives "structure too large" (leading to the original message in this >thread), then > > ^Array[1..5000]of index > >will also give "structure too large". 5000*SizeOf(Index) = 85000 bytes. > >You subsequently proposed a solution which _will_ work: the array of >pointers (or pointer to an array of pointers). [...] I disagree with Karl on the first point: the SizeOf a variable of type ^array[1..5000] of index will be 4 (it's a pointer). Using New(IndexPtrVar) will result in 85000 bytes being allocated on the heap. The array of pointers will result in 5000 * SizeOf(Ptr) = 20000 bytes on the stack with some variable amount on the heap. The pointer to an array of pointers will result in SizeOf(Ptr) = 4 bytes on the stack with 20000 + some variable amount bytes on the heap. The last two are really only different (other than how to dereference them) in that one places the array of pointers on the stack, the other on the heap. Brendan -- Brendan B. Boerner Phone: 512/471-3241 Microcomputer Technologies The University of Texas @ Austin Internet: boerner@emx.cc.utexas.edu UUCP: ...!cs.utexas.edu!ut-emx!boerner BITNET: CCGB001@UTXVM.BITNET