How to make a block of memory allocated by malloc() or new:
- immediately swapped out,
- or lazily initialized.
In fact, I’m trying to reserve an address space. How to accomplish this?
PS. How to verify, from the user space, if a memory block is swapped out?
To reserve a chunk of address space:
On unix, sbrk() or mmap().
On Windows, VirtualAlloc().