Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!samsung!zaphod.mps.ohio-state.edu!rpi!batcomputer!cornell!calvin.spp.cornell.edu!richard From: richard@calvin.spp.cornell.edu (Richard Brittain) Newsgroups: comp.sys.ibm.pc.programmer Subject: How to trim program size before calling spawn() in TC Message-ID: <1990Mar21.081326.12154@calvin.spp.cornell.edu> Date: 21 Mar 90 08:13:26 GMT Reply-To: richard@calvin.spp.cornell.edu (Richard Brittain) Organization: Cornell Space Plasma Physics Group Lines: 18 The subject line pretty much says it all. I want to be able to shell out of a small program, leaving the bare minimum behind (no heroics, swapping or anything like that). The default seems to leave a full 64k in the tiny model (in case I have malloced a bunch of stuff I suppose). I have figured out how to trim the fat some by manually setting _stklen and _heaplen, but I did that just by trial and error. Is there a way to discover the actual size and free the memory above that point before calling spawn(). I tried brk() but it didn't seem to do anything - it still left 64k behind (maybe I gave it a silly argument and it was ignored). The final program will either be tiny or small model, if it matters. Thanks for any help. Richard Brittain, School of Elect. Eng., Upson Hall Cornell University, Ithaca, NY 14853 ARPA: richard@calvin.spp.cornell.edu UUCP: {uunet,uw-beaver,rochester,cmcl2}!cornell!calvin!richard