79730083

Date: 2025-08-08 17:41:17
Score: 0.5
Natty:
Report link

You can reserve a large, contiguous address space by using mmap with PROT_NONE (no permissions). Then, you can later "grow" into this allocation by using mprotect to update a segment with the proper permissions. This way, you can mmap the maximum amount of memory needed, which will ensure the pages are virtually continuous but not yet mapped to a physical page until the protections are incrementally updated.

Reasons:
  • Has code block (-0.5):
  • Single line (0.5):
  • Low reputation (0.5):
Posted by: p011y