Mail Archives: djgpp/2004/03/20/18:01:36
On 20 Mar 2004 07:38:50 -0800 in comp.os.msdos.djgpp, kantsel AT mail DOT ru
(Anthony) wrote:
>DJ Delorie <dj AT delorie DOT com> wrote in message news:
><200403191751 DOT i2JHp99L022683 AT envy DOT delorie DOT com>...
>> > 1. What memory should I monitor (DOS (below 1MB), upper,...)
>>
>> Virtual.
>>
>> > 2. How can do that?
>>
>> You don't want to monitor free memory, you want to monitor *used*
>> memory (other things on the computer might use memory too). Most
>> programs can use the sbrk(0) call to ask libc where the top of your
>> memory is. If it doesn't change, you're not asking for more memory.
>>
>> The exception is if you choose the "non-moving sbrk" option (nearptr,
>> DMA, etc need this) in which case your memory range is discontiguous
>> and sbrk() moves all over the place during allocation. But at least
>> you can tell if it changes *at all*.
>
>Thanks, I'll use it. But sill, if I want to know how much memory do I
>have left, how can I?
There's a bunch of new functions giving malloc information, esp.
mallinfo, malloc_debug, mallocmap, in the DJGPP 2.04 beta release, if
you want to go to the effort of installing and trying a beta release.
--
Thanks. Take care, Brian Inglis Calgary, Alberta, Canada
Brian DOT Inglis AT CSi DOT com (Brian dot Inglis at SystematicSw dot ab dot ca)
fake address use address above to reply
- Raw text -