Xref: news2.mv.net comp.os.msdos.djgpp:6092 From: John Sabean Newsgroups: comp.os.msdos.djgpp Subject: Re: Question Date: Wed, 17 Jul 1996 16:43:44 -0400 Organization: Project GLUE, University of Maryland, College Park, MD Lines: 34 Message-ID: <31ED5080.41C67EA6@eng.umd.edu> References: <4sj8k9$lfr AT news DOT xs4all DOT nl> NNTP-Posting-Host: x-15.umd.edu Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp jlist wrote: > > After the praise message, I have a question. :) > > I am currently developing a game (yeah....who isn't these days....) and it > would be really handy to know how much data is taken in by all the stuff > in the program, so I can detect at startup whether enuff memory is in the > system. > > How in an efficient way? I already thought of sizeof() stuff and that and > totalling the amount when compiling and running the final version (just a > guess....that's what this group is for eh? ;) but there has to be a better > and more efficient way to do this. > > Ohyeah, I am using DJGPP v2.0. ;) > You could try using the functions: _go32_dpmi_get_free_memory_information(*) See - http://www.delorie.com/djgpp/doc/libc-2.00/libc_352.html#SEC352 Use the function twice. Once before you allocate anything, then once after you allocate everything. Then, subtract the two states and thats how much memory you have used! Good luck, John -- "I've always said you can get more with a kind word and a 2x4 than you can with a kind word alone!" - Marcus