From malloc(9):
For allocations larger than PAGE_SIZE, it is obviously possible (and likely!) for the returned pages to be physically noncontiguous.
Is it also possible for smaller chunks to be noncontiguous, or is it safe to assume that PAGE_SIZE and smaller allocations are contained within a single physical page?
-Andrew
Code:
IMPLEMENTATION NOTES
The memory allocator allocates memory in chunks that have size a power of
two for requests up to the size of a page of memory. For larger
requests, one or more pages is allocated. While it should not be relied
upon, this information may be useful for optimizing the efficiency of
memory use.
For allocations larger than PAGE_SIZE, it is obviously possible (and likely!) for the returned pages to be physically noncontiguous.
Is it also possible for smaller chunks to be noncontiguous, or is it safe to assume that PAGE_SIZE and smaller allocations are contained within a single physical page?
-Andrew