linuxgcc64-bitportinglarge-address-aware

Linux/64-bit /LARGEADDRESSAWARE equivalent


Windows enables you to restrict address-space usage to a 32-bit resolution by setting a flag in the PE header (/LARGEADDRESSAWARE). To elaborate: When set, this flag effectively emulates a 32-bit virtual address space environment (image is loaded at/allocations return- addresses <= 0xFFFFFFFF)

Does Linux have an equivalent feature?


Solution

  • Allocating memory in 32-bit space on x86-64 can be done by performing mmap(2) with the MAP_32BIT flag.