Mail Archives: djgpp/1999/10/21/13:09:06
On Wed, 20 Oct 1999 kriiid AT my-deja DOT com wrote:
> It look pretty inefficient (if it is done for every malloc).
Who said it's done for every malloc? The function that gets memory
from the DPMI host allocates it in chunks of 64KB, unless the program
asks for larger chunks.
Of course, if you'd write a program that does nothing except allocate
64K+1 byte in a loop, that would be somewhat inefficient, but that's a
toy program, not a real-world application.
> mov [precoo],ebx
>
> And then I just use [precoo]...
This is your problem: you have allocated memory, but didn't make sure
your DS segment limit includes that memory. In most cases, you will
need to enlarge the limit, otherwise you get a GPF.
> Changing base is not really a good idea, because what to do with data
> allocated within DS using db or something.
Sometimes, you don't have a choice, for example, if you resize a block
and the new block is at a different address. DPMI spec doesn't have
any provision for you to control where exactly in the linear address
space does the DPMI host put the memory blocks you request.
- Raw text -