3 ms·
> But would this be a good idea to implement? Could there be a benefit? > In Unix land, in addition to munmap, we also have madvise, which is a BSD function, k
by pcwalton 10y ago
> But would this be a good idea to implement? Could there be a benefit?
> In Unix land, in addition to munmap, we also have madvise, which is a BSD function, known in POSIX as posix_madvise. One of the things an application can do with these functions is tell the OS that it "won't need" a range of memory (POSIX_MADV_DONTNEED / MADV_DONTNEED).
As mentioned in the article, Win32 has something that addresses the problem described as well: VirtualAlloc(..., ..., MEM_RESET, ...).