Boost logo

Boost Users :

Subject: Re: [Boost-users] Memory mapped files
From: Niall Douglas (s_sourceforge_at_[hidden])
Date: 2019-01-23 14:12:08


> C++ make NO guarantee that in-memory organization of data structures
> will match between different architectures, and there is nothing Boost
> can do to make those structures match between architectures.

It's even stronger than that: the C++ standard makes no guarantee that
in-memory representation of storage does not change between program
executions, let alone between different compilers or architectures. To
use mapped memory at all outside a single program execution is pure
undefined behaviour. You are literally on your own wrt the standard.

(I have a proposal in the works for WG21 SG12 which will propose how to
add support for shared and paged memory to C and C++, but even it
specifically excludes the ability to use storage by programs other than
the program which constructed the objects. And even that, the standard
requiring that the same program binary always uses the same in-memory
representation, will be very, very controversial e.g. imagine JITed or
translated C++ for example)

Niall


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net