Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!wuarchive!zaphod.mps.ohio-state.edu!lavaca.uh.edu!uhnix1!sugar!karl From: karl@sugar.hackercorp.com (Karl Lehenbauer) Newsgroups: comp.sys.amiga.tech Subject: Re: De-Allocating Memory? Message-ID: <5678@sugar.hackercorp.com> Date: 9 May 90 15:25:43 GMT References: <12750@wpi.wpi.edu> <29676@ut-emx.UUCP> Reply-To: karl@sugar.hackercorp.com (Karl Lehenbauer) Organization: Count Floyd's 3-D House of Unix Lines: 26 In article <29676@ut-emx.UUCP> greg@walt.cc.utexas.edu (Greg Harp) writes: >In article mwm@raven.pa.dec.com (Mike (Real Amigas have keyboard garages) Meyer) writes: >>Lattice's memory routines allocate a growing pool. Doing a free() >>doesn't release the memory back to the OS, but puts it back in the >>pool for reuse by the Lattice memory manager. >Sin! Sin! Sin! PLEASE don't tell me Manx does the same thing!! OK, it doesn't. But you don't want to malloc() under Manx anyway, usually, because it does search through a linearly linked list containing an entry for each chunk of memory you've malloc'ed to determine whether or not the memory you're freeing was actually allocated (eliminating a source of gurus, but doing it silently -- it doesn't report if you tried to free something you didn't allocate, it just ignores it), which can get quite slow if you've called malloc a bunch of times. Besides, the Amiga puts a finer point on memory allocation than malloc supports, that is, do you want chip or fast RAM, public or private (try to use MEMF_PUBLIC where relevant in case there's a protected mode version of AmigaDOS sometime in the future). Disclaimer: This is from examining the library source to 3.6. I haven't checked the 5.0 libsrc to see if they've changed their methods. -- -- uunet!sugar!karl -- Usenet access: (713) 438-5018