Path: utzoo!attcan!uunet!seismo!sundc!pitstop!sun!imagen!atari!apratt From: apratt@atari.UUCP (Allan Pratt) Newsgroups: comp.sys.atari.st Subject: Re: Another great quote from Mr. Good Message-ID: <1121@atari.UUCP> Date: 17 Aug 88 17:12:51 GMT References: <1116@atari.UUCP} <692@auvax.UUCP} Reply-To: apratt@atari.UUCP (Allan Pratt) Distribution: comp Organization: Atari (US) Corporation, Sunnyvale, California Lines: 28 In article <692@auvax.UUCP} rwa@auvax.UUCP (Ross Alexander) writes: } In recent articles, Roy J. Good @ Atari and others discuss the Malloc } problem (qv). May I suggest the following solution: } } 1) build a proper version of Malloc (MallocP for "malloc } patched" comes to mind). Assign it a TOS-call number, and } give it reasonable semantics; Un*x semantics are as } reasonable as any. } } 2) use this reasonable allocator as a foundation for a } version broken in exactly the same ways as the current TOS } version. That is, it obeys the assumptions that people are } making about the current allocator (that it's okay to } exceed your chunk, that chunks are contiguous, et al.), and } make this broken allocator available through the old } TOS-call number. But this doesn't fix anything! The whole reason that Malloc is broken is that you can't allocate an arbitrary number of blocks, because a static area of memory is set aside for block descriptors. Any reasonable malloc uses the blocks themselves to keep track (by using the space just before or just after a free block as linkage to the next block), but we can't do that because people keep messing with memory they don't own, and so on. ============================================ Opinions expressed above do not necessarily -- Allan Pratt, Atari Corp. reflect those of Atari Corp. or anyone else. ...ames!atari!apratt