Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!uc!cs.umn.edu!thelake!steve From: steve@thelake.mn.org (Steve Yelvington) Newsgroups: comp.sys.atari.st.tech Subject: Re: Re: malloc Message-ID: Date: 20 Jul 90 16:02:28 GMT References: <7885@jarthur.Claremont.EDU> Organization: Otter Lake Leisure Society Lines: 24 X-Member-Of: STdNET [In article <7885@jarthur.Claremont.EDU>, dcrevier@jarthur.Claremont.EDU (Dan Crevier) writes ... ] > I remember a long time ago a discussion about malloc, and bugs in it. Was > there ever a new version of malloc posted or a good fix? The problem is in Malloc(), GEMDOS function 0x48. There is a limit on how many times you can call it, and I think you have to free memory in the reverse order. TOS 1.4 may have fixed some of these problems, but you can hardly depend on TOS 1.4 being installed in the average ST when Atari is still shipping computers without it. Most C compilers get around the difficulties by calling Malloc() to allocate a large chunk of memory, then parceling out little chunks as necessary. You can see how this works by examining the source code to the dLibs C library. (There is a bug in dLibs realloc() function. First person to *post* a fix gets a banana split at the Cup 'N' Cone in White Bear Lake. Transportation not included. Offer void where prohibited by cholesterol levels.) -- Steve Yelvington at the lake in Minnesota steve@thelake.mn.org