Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!rutgers!mcnc!rti!sunpix!matthew From: matthew@sunpix.UUCP ( Sun NCAA) Newsgroups: comp.lang.c Subject: Re: What if I don't free() all my dynamically allocated memory? Keywords: On a Unix system, that is. Message-ID: <585@greens.UUCP> Date: 7 Apr 89 13:03:46 GMT References: <2580@ssc-vax.UUCP> Organization: Sun Microsystems, Research Triangle Park, NC Lines: 19 In article <2580@ssc-vax.UUCP>, dmg@ssc-vax.UUCP (David Geary) writes: [complaints about _free() speed deleted.] I doubt that you would have now problem, except if your program was used so much that it ran out of allocatable memory. I did have an Idea though, if you are constantly malloc()ing and free()ing memory, why not create your own free routine {myfree()} what would add the now unused struct to a list of reusable structs, rather than free()ing it up for the processors use. Then when you need space for another struct, your personal malloc() {mymalloc()} would try getting a a myfree()'d struct, and failing that, malloc() a new struct. -- Matthew Lee Stier | Sun Microsystems --- RTP, NC 27709-3447 | "Wisconsin Escapee" uucp: { sun, mcnc!rti }!sunpix!matthew | phone: (919) 469-8300 fax: (919) 460-8355 |