Path: utzoo!attcan!uunet!jarthur!elroy.jpl.nasa.gov!swrinde!zaphod.mps.ohio-state.edu!rpi!uupsi!sunic!kth.se!cyklop.nada.kth.se!news From: d88-jwa@aswad.nada.kth.se (Jon W{tte) Newsgroups: comp.sys.mac.programmer Subject: Re: Linked Lists: Handles or Pointers? Message-ID: <1991Jan24.145332.12611@nada.kth.se> Date: 24 Jan 91 14:53:32 GMT References: <1991Jan23.002212.7648@umiami.ir.miami.edu> Organization: Royal Institute of Technology, Stockholm, Sweden Lines: 20 In article <1991Jan23.002212.7648@umiami.ir.miami.edu> gross@umiami.ir.miami.edu (Mondo) writes: >Okay folks, here's yer big chance to solve a silly little argument for >three of us novice Mac programmers. > a) Use a handle to the head node only and use pointers > for the rest of the list (Problem we see: the Memory > Manager will compact the heap and make all those ptrs invalid.) You could allocate with NewPtr. The problem is that this fragments the heap and is SLOOOOW due to a memory mgr bug in the IIfx and ci. > b) Use linked handles for every node in the list. Yup ! Or, if the list is "small", a handle containing all the elements, that you just resize... Jon W{tte, Stockholm, Sweden, h+@nada.kth.se :: This article is fake. If you take it for real, the _REAL_ :: Jon W{tte will sue you for slander. So there ! Nyah ! :-)