https://github.com/eldruin/reservebottommemory
Reserve all of the bottom memory to force allocations to start above the 4GB line. This can easily expose 64-bit compatibility issues.
https://github.com/eldruin/reservebottommemory
64bit allocation cplusplus debug
Last synced: 8 months ago
JSON representation
Reserve all of the bottom memory to force allocations to start above the 4GB line. This can easily expose 64-bit compatibility issues.
- Host: GitHub
- URL: https://github.com/eldruin/reservebottommemory
- Owner: eldruin
- License: apache-2.0
- Created: 2017-09-11T07:58:10.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-09-19T14:38:41.000Z (over 8 years ago)
- Last Synced: 2024-10-16T05:29:33.029Z (over 1 year ago)
- Topics: 64bit, allocation, cplusplus, debug
- Language: C++
- Size: 11.7 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ReserveBottomMemory
Reserve all of the bottom memory to force allocations to start above the 4GB line.
This can easily expose compatibility issues when porting 32-bit code to 64 bit.
The original code was taken from: https://randomascii.wordpress.com/2012/02/14/64-bit-made-easy/
## How to use
Call `ReserveBottomMemory()` as early as possible in your process and
`FreeBottomMemory()` at the end.
## How to build
Running cmake will create a VisualStudio solution with a shared library
called `ReserveBottomMemory` and its tests.
You can build them and run the tests as usual with cmake solutions.
## Integration into your project
You can either:
- Build the shared library with cmake as described above and link to it in your
project.
- Include the source file directly in your project.
- If you want to use some other build system just create a shared library
with the source and header file and define `RESERVEBOTTOMMEMORY_SOURCE`
to export the symbols.
## Tests
Tests have been added to check that after calling `ReserveBottomMemory()`
allocations return high memory addresses.
See the `tests` folder.
## Platforms supported
Currently only 64-bit Windows is supported.
## License
Apache License 2.0
http://www.apache.org/licenses/LICENSE-2.0