Mail Archives: djgpp/1998/05/06/20:05:36
At 01:21 5/6/1998 GMT, degausse wrote:
>I want to allocate a buffer for page flipping (for graphics animation).
>Which should I use -- malloc, new or __dpmi_allocate_memory, so that the
>performance is optimal?
It makes absolutely no difference as far as performance is concerned-- it's
all the same memory. However, I'd advise against using
`__dpmi_allocate_memory' for any task for which it is not absolutely
necessary, since it's so much more complicated to use. `new' will probably
make more sense if you're using C++, otherwise `malloc' is fine.
If you want to be assured that your buffer does not get swapped out, you can
use `__dpmi_lock_linear_region'. Note that this requires that enough
physical memory be free.
Nate Eldredge
nate AT cartsys DOT com
- Raw text -