Provide a set of portable utilities for memory manipulation.
More...
Namespaces |
namespace | bdls |
Detailed Description
- Outline
-
-
- Purpose:
- Provide a set of portable utilities for memory manipulation.
-
- Classes:
-
-
- Description:
- This component,
bdls::MemoryUtil
, defines a platform-independent interface for memory manipulation, providing utilities for querying page size, allocating/deallocating page-aligned memory, and utility to change memory protection.
-
- Usage:
- First, allocate one page of memory. Write into the allocated buffer.
- Make the memory write protected
- Verify that data still could be read.
- Once again, try writing into the buffer. This should crash our process.
- Restore read/write access and free the allocated memory. Actually, this will never be executed, as the process has already crashed.