Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!rpi!batcomputer!braner From: braner@batcomputer.tn.cornell.edu (Moshe Braner) Newsgroups: comp.sys.ibm.pc.programmer Subject: adding to the heap? Summary: how to add holes in conventional memory to malloc's heap? Message-ID: <9898@batcomputer.tn.cornell.edu> Date: 13 Mar 90 02:04:00 GMT Reply-To: braner@tcgould.tn.cornell.edu (Moshe Braner) Distribution: usa Organization: Cornell Theory Center, Cornell University, Ithaca NY Lines: 29 Hello net.people! I had this really hooky idea, that it aught to be possible to take areas of memory that are known to be available, and telling malloc() somehow that they are OK free blocks. I am thinking of the malloc() library function of the C compiler packages, in the large-data models (compact, large), or the farmalloc() function in the small model. The holes I'd like to use include: unused parts of "shadow" RAM above 640K but below 1 meg, an EMS window, and even the first 64K (minus 16 bytes) of extended RAM, which supposedly you can cheat and read from "real" mode (using the segment FFFFH, offsets over 000FH - is that really possible?). Together it should be possible to gain well over 100K, to be used in your program in a completely transparent manner (if you program does a lot of small malloc()s). So, has anybody tried this? Does anybody have code to do this? (You'd have to set up the block with the right stuff before you call free() on it -- unless you compiler's library has a function for adding a new block.) I am looking for such code for Turbo C 2.0, but I am sure other people could use examples for MS C or other languages (Pascal, Modula 2). - Moshe Braner Cornell Theory Center, 265 Olin Hall, Cornell University, Ithaca, NY 14853 USA (607) 255-9401 (INTERNET) (BITNET)