C++ Logo


Advanced search

Re: [ub] Draft 2 of Enhanced C/C++ memory and object model

From: Niall Douglas <s_sourceforge_at_[hidden]>
Date: Wed, 27 Mar 2019 09:51:02 +0000
On 26/03/2019 22:24, Myria wrote:
> Does the proposal attempt to handle the case where a single map_view is
> mapped to two locations simultaneously within a given program? This is
> sometimes called "mirror mapping". I suppose that optimizing compilers
> could be really confused by mirror mapping. This is probably already
> true, but so far, programmers have done things like make circular
> buffers using mirror mapping without too much difficulty.

As is clearly stated in the proposal, compilers can hard assume that
memory locations for live objects will never alias. It is implementation
defined what happens if an object is attached to more than one program,
or memory location, at a time (and there is a strong argument to make it
into an error, but this is yet to be discussed).


Received on 2019-03-27 10:51:17