Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!csc.ti.com!ti-csl!tilde.csc.ti.com!axis!logic.dsg.ti.com!bruce From: bruce@logic.dsg.ti.com (Bruce Florman (BFLM)) Newsgroups: comp.sys.mac.programmer Subject: Re: malloc() in Think C programming on the Mac Message-ID: <1991Feb1.214903.511@axis.dsg.ti.com> Date: 1 Feb 91 21:49:03 GMT References: <1CE00001.m1ny6l@tbomb.ice.com> Sender: news@axis.dsg.ti.com (System News Administ) Organization: Texas Instruments, Austin, Tx. Lines: 43 In article <1CE00001.m1ny6l@tbomb.ice.com> time@ice.com writes: > >We have a version of malloc written here at ICE specifically for the >Macintosh. It is really nice and uses "pools" allowing me to separate >the areas in which memory is allocated. This also solves "leak" problems, >as I can allocate "leaky" objects in one specific pool, then at some >predetermined time free the entire pool and not worry about freeing >individual objects! > >We are considering posting this code to the net. Anyone interested? >If so, it will take time to document the code and clean it up for >release, so it won't happen soon, but it won't happen at all if there >is little interest. > >tim. > I would be very much interested in seeing your code. I've recently been writing a number of C tools, including a memory allocation module, and I'm always eager to see how others approach the same problems. I've rolled my own allocater in order to integrate an exception handling module that I've been working on for awhile: if the allocation request can't be satisfied with the available memory, an exception is raised, throwing control back to the most recently activated handler. This frees the programmer from having to clutter his or her code with a lot of error checks, since if the allocation call returns at all, it has successfully filled the request. My exception handling module is probably also a good candidate for posting, is there any interest out there? It currently has compile-time conditionals which allow it to be compiled in THINK C or MPW for the Mac, or in GNU C on the TI 1500 (and probably any other 680x0 based machine, but I don't have any others to try it on). >------------------------------------------------------------- >Tim Endres | time@ice.com >ICE Engineering | uupsi!ice.com!time >8840 Main Street | Voice FAX >Whitmore Lake MI. 48189 | (313) 449 8288 (313) 449 9208 --Bruce Florman florman@itg.ti.com