Mail Archives: djgpp/1999/07/03/13:45:25
Pavlos wrote:
>
> Let's say I allocate any size of memory using malloc(). Can I always assume
> that this block of memory will not be fragmented? Even if it is huge?
Define "fragmented". It will appear to your program as a contiguous
block of memory-- no holes. But where, or even if, it exists in
physical memory is not guaranteed. It may be physically scattered
across RAM, but the virtual memory mechanisms make this invisible to
you.
So, for the purposes of C, it's not fragmented. For the purposes of DMA
or other external hardware, it may well be.
--
Nate Eldredge
nate AT cartsys DOT com
- Raw text -