Allows a compiled application to handle addresses larger than 2 gigabytes.
$LargeAddressAware
Specify the $LargeAddressAware in the code. When the program is compiled to EXE, the Large Address Aware box is automatically ticked and the compiled program is modified to handle memory addresses above 2 GB, theoretically allowing access to up to 4 GB of virtual memory. Normally, a 32-bit application can address only the first 2 GB of memory, when it is large address aware it can access the additional 2 GB memory on 64-bit operating systems that isn’t used by the OS.
' Compile to EXE to show available memory
$Library "gfawinx"
$LargeAddressAware
OpenW 1
AutoRedraw = 1
Print "Available Memory:"; MemStat(6)
Do
Sleep
Until Me Is Nothing
GfaWin32.exe, the IDE/compiler, is a 32-bit application and has been large address aware for many years now without any noticeable problems. To provide your EXE with the same amount of memory as when it is run in the IDE, the compiled EXE must be modified to allow this using $LargeAddressAware.
Allowing access to memory addresses > 2 GB may present problems (search for Large address aware on the internet), so GB32 does not modify the EXE by default. The application must choose to do so.
The Create Exe dialog (also known as Compile to Exe) contains a Large Address Aware checkbox to modify the EXE. The drawback is that you need to check it each time the program is compiled.
NOTE: If you untick 'Large Address Aware' in the compile form, this keyword no longer has the desired effect.
{Created by Sjouke Hamstra; Last updated: 11/08/2022 by James Gaite}