Mail Archives: djgpp/1999/08/23/07:46:38
I can fully confirm this experience. I used a database whith chess
positions. A lot of records were inserted and deleted.
In DOS days, when you had 100kb and freed 10 kb, you automatically had
110 k free RAM. Under Win this is not necessarily the case, due to
memory fragmentation. I noticed this with *all* compilers under win.
If you want to avoid this I m afraid you have to write your own mem
mgt routines. For example alloc larger chunks of mem normally and
manage allocs/free's on record-level yourself.
Regards,
Bas Hamstra.
"Ben Davis" <ben AT vjpoole DOT freeserve DOT co DOT uk> wrote:
>I am writing a program in DJGPP C, which uses the memory VERY dynamically:
>there are loads of malloc()s and free()s. They occur in a strange order, and
>some are quite large. If two blocks are allocated, and then the first one is
>freed, and then a third, larger block is allocated before the second one is
>freed, some memory is wasted (I fear).
>What I would like to know is, does DJGPP automatically compact the memory by
>moving blocks down to fill all the gaps, or do I have to do it manually? How
>can I do this?
- Raw text -