Mail Archives: djgpp/1997/07/28/12:07:00
On Thu, 17 Jul 1997 15:48:07 GMT, Nate Eldredge <eldredge AT ap DOT net>
wrote:
>>When I malloc a structure that takes up say 34k, djgpp or dpmi takes
>>64k, a loss of 20k.
>>So if I allocate 32 structures, I lose 640k.
>AFAIK, no you don't. malloc uses sbrk to get memory from the DPMI server. It
>gets *that* memory in powers of 2 to reduce overhead, but then parcels it
>out to malloc calls as it's needed. So each structure should just be using a
>34K block, it's just that malloc grabbed some extra which will be given to
>the next request.
>
>What makes you think you are losing memory?
Good point, I tried using different size arrays, and the only memory
lost is the unused part of the last 4096 byte page allocated for each
malloc. I'm now using short instead of int, it saves a lot of memory.
Does anyone know where this !@#$%! six wheeled robot came from?
t, after
already-trademarked items. They're intended for internal use only (though
they always leak out), and they rapidl fall out of use once a product
ships, so there's no reason (and in fact would be a great deal of
liability involved) why a company would attempt to trademark codenames.
--
Erik Max Francis, &tSftDotIotE / email / max AT alcyone DOT com
Alcyone Systems / web / http://www.alcyone.com/max/
San Jose, California, United States / icbm / 37 20 07 N 121 53 38 W
\
"Love is not love which alters / when it alternation finds."
/ William Shakespeare, _Sonnets_, 116
- Raw text -