Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!julius.cs.uiuc.edu!ux1.cso.uiuc.edu!uxa.cso.uiuc.edu!ml27192 From: ml27192@uxa.cso.uiuc.edu (lanett mark) Newsgroups: comp.sys.mac.programmer Subject: Re: Linked lists Keywords: Linked lists Pascal Think Message-ID: <1991Feb11.194548.27205@ux1.cso.uiuc.edu> Date: 11 Feb 91 19:45:48 GMT References: <91FEB11.084805@ducvax.auburn.edu> Sender: news@ux1.cso.uiuc.edu (News) Organization: University of Illinois at Urbana Lines: 21 cs220x2a@ducvax.auburn.edu (CS220X) writes: >I'm working on an application in Think Pascal 3.0 and need to use a linked >list. >The problem is, how do I avoid the memory manager moving all of my nodes >around? I could make them all non-relocatable, but that would result in a >tremendously fragmented stack (or is it heap? I always forget). >Finally, since I know I'll never have more than 50 elements, I could use an >array-implemented linked list, but I'd rather use pointers and not place any >restrictions on something that may expand in the future. If you're only dealing with ~50 items (for now) use NewPointer. That few items won't eat up so much space or fragment the heap much. NewPointer tries to compact the heap (not stack) before allocating anyway. Mark Lanett -- /////////////////////////////////////////////////////////////////////////////// Mark Lanett ml27192@uxa.cs.uiuc.edu