::operator new ( ) ++ (- ++, , โโ n3337). ( , ++, OS - , ). , new delete ( , ).
: ( ).
, Microsoft . , Microsoft Windows. , . , , . , .
++, , (, - Linux mmap (2), , Windows, ). , process .
" , "
( ), (, VirtualAlloc, new malloc - LoadLibrary ). BTW, x86-64 ( , MMU) 4kbytes, , 1024 .
(. PS , Iinspectable Microsoft, " " , - : wikipedia, )
(, new, , ). new malloc ( C), , free -d , . ++ . .
, , , . , , , delete -d ( free -d) .
BTW, Linux, ++, ++, C โโfree , , gory.
, ( mmap (2) Linux, VirtualAlloc , LoadLibrary , , Windows). BTW, Linux proc (5) ( /proc/self/maps), . , - Windows . VAS , " , , ", , (, VirtualAlloc Windows mmap Linux).
Iinspectable , , . wikipedia, 1970- IBM
, - 100 KiB 400 KiB
, ++ ( ), . , ASLR ( , ).
, ::operator new ( , , delete). , , :
void* ::operator new ( std::size_t count ) { throw std::bad_alloc; }
. . malloc. !
( - , , , )
PS. , Microsoft ( Iinspectable ) " " , . wikipedia , Operating : (. 13). , ISA, ( IIRC 48 Ryzen, . figure x86-64 wikipage ). "segment " [] " , ", , . ( ). AMD (256 ) ยง2.1.5.1 AMD Ryzen, ( ). ( , MMU). , "" - "" - . , - , ( , - , ) . ( ), . Linux mmap (2) " ", VAS.
PPS thrashing ( ). - ( ). operator new malloc VAS ( ) (, VirtualAlloc Windows mmap sbrk Linux). Microsoft , virtual address space means something else that remains forever unchanged (but this is not very interesting and is not a feature of the process, but the hardware that AMD calls "virtual memory", see also this ).
NB. I do not know Windows and have never used it (and I hope never to write on it in my professional life). But I have been programming since 1974 and have been using Unix-like systems since 1987. Today I am a Linux user, and I know a bit about the internal components of the GCC compiler.