delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/07/17/19:02:28

Xref: news2.mv.net comp.os.msdos.djgpp:6092
From: John Sabean <docmani AT eng DOT umd DOT edu>
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
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

-- 
<docmani AT eng DOT umd DOT edu ------ http://www.glue.umd.edu/~docmani>
"I've always said you can get more with a kind word and a
 2x4 than you can with a kind word alone!"  - Marcus

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019