Mail Archives: djgpp/2000/07/06/08:50:05
Sorry for that. What I ment was that if for instance I measure 104Kb
usually, then running again with slight modification (clearly
unrelated to memory usage) I get 170MB as output. I thought that my
casting choise is wrong. Maybe the program allocate memory not
sequentially?
On Wed, 5 Jul 2000 19:16:38 +0300 (IDT), Eli Zaretskii
<eliz AT is DOT elta DOT co DOT il> wrote:
>
>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 -