Mail Archives: djgpp/1998/09/04/11:30:47
George Foot wrote:
>
> On 4 Sep 98 at 3:28, SuSaNNa wrote:
>
> > well, but if i need to "reality" free my memory, What can i do?
>
> Allocate it yourself using DPMI functions to obtain a memory block
> from the DPMI server, and free it yourself when you've finished with
> it. Look up `__dpmi_allocate_memory' and `__dpmi_free_memory' if
> you really need to do this, but why do you really care whether or
> not the memory is really free? It'll be paged to disk sooner or
> later because it's not being used any more. In a single-tasking
> environment, your program is the only one running, and your program
> can reuse the memory so there's no problem. By far the most common
> multitasking environment is Windows, which is relatively stingy with
> memory anyway. It only offers you memory out of a certain quota
> anyway, so there's probably plenty left even if you burned up
> everything it offered you.
Well, thanks George, now i understand the diference between malloc and
__dpmi_allocate_memory, but i'm using allegro library (a wonderfull
library) and allegro uses malloc() and free() to allocate bitmap
structure and bitmap data, when i repeatly load and free diferents
bitmaps of diferents sizes i see that the dpmi not reuse all available
memory.
My program uses about 60Mb of graphic data and i have only 16Mb of ram
and i don't have free
hard disk space, i load graphics in blocks of 10Mb maximum, a block of
graphics for
every stage of my game, and when i load and free repeatly, the memory
manager crash. Why?.
You saidme that when i free a malloc, dpmi can reuse the space by
another malloc, but if i load the
blocks in a maximum of 10Mb and i have 16Mb, ¿why the system crash?.
please helpme.
Thanks for readme. sorry for my bad english, and sorry if i'm asking for
an obvious answer.
- Raw text -