www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/07/05/12:17:19

Date: Wed, 5 Jul 2000 19:16:38 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: djgpp AT delorie DOT com
Subject: Re: Amount of Memory used by a djgpp program.
In-Reply-To: <396352ca.29983468@news.huji.ac.il>
Message-ID: <Pine.SUN.3.91.1000705191516.14785C-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Wed, 5 Jul 2000, Hbar wrote:

> Thnx, I'm using this method, but sometimes I'm getting proper numbers
> and sometimes not. Am I casting wrong? Should the *mem pointers be
> void? This is my code:
> 
> char *memi,*memf;
> memi=(char *)sbrk(0);
> //my program
> memf=(char *)sbrk(0);
> printf("\nTotal memory used %dKb\n",((unsigned
> long)(memf-memi))/1024);

It would help *tremendously* if you say what are the ``improper'' numbers 
that you get sometimes.  I'm not good enough at guessing something that 
happens out of my sight ;-)

- Raw text -


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