Elsewhere Memory (C++20 Abstract Machine) + Virtual Memory

By Niall Douglas

The C++20 object and memory model has no support for memory allocated from, or managed by, elsewhere to the currently running C++ program. This makes it impossible to legally write a dynamic memory allocator which uses memory not available to the C++ program when it began life, so global operator new in every hosted C++ implementation today relies on undefined behaviour. For similar reasons, shared memory, memory mapped files, or even virtual memory, cannot be legally used in C++ programs without relying on undefined or unspecified behaviour. P0593 Implicit creation of objects for low-level object manipulation "solves" this by enabling the C++ program to tell the compiler "trust me, I’m the programmer", which is a useful stop-gap, but it leaves one wanting for something better.

This talk will recap the C++20 object and memory model, illustrating the mismatch between reality on the ground for the programmer for over twenty years, and the C++ programming language. We will look at the next generation of storage devices which directly expose to the host computer the on-device internal filing system (e.g. the Samsung KV-SSD), such that i/o is exclusively key-value load and store operations, rather than reads and writes of bytes. We shall muse on how a future C++ object and memory model might be adjusted to more closely match hardware and kernel reality.





Your Privacy

By clicking "Accept Non-Essential Cookies" you agree ACCU can store non-essential cookies on your device and disclose information in accordance with our Privacy Policy and Cookie Policy.

Current Setting: Non-Essential Cookies REJECTED


By clicking "Include Third Party Content" you agree ACCU can forward your IP address to third-party sites (such as YouTube) to enhance the information presented on this site, and that third-party sites may store cookies on your device.

Current Setting: Third Party Content EXCLUDED



Settings can be changed at any time from the Cookie Policy page.