Title
Aliasing and allocation functions
Status
cd4
Section
6.7.6.5.2 [basic.stc.dynamic.allocation]
Submitter
Jason Merrill

Created on 3022-08-03.00:00:00 last changed 95 months ago

Messages

Date: 2014-11-15.00:00:00

[Moved to DR at the November, 2014 meeting.]

Date: 2014-02-15.00:00:00

Proposed resolution (February, 2014):

Change 6.7.6.5.2 [basic.stc.dynamic.allocation] paragraph 2 as follows:

...If the request succeeds, the value returned shall be a non-null pointer value (7.3.12 [conv.ptr]) p0 different from any previously returned value p1, unless that value p1 was subsequently passed to an operator delete. Furthermore, for the library allocation functions in 17.6.3.2 [new.delete.single] and 17.6.3.3 [new.delete.array], p0 shall point to a block of storage disjoint from the storage for any other object accessible to the caller. The effect of indirecting through a pointer returned as a request for zero size is undefined.36
Date: 2013-09-15.00:00:00

Notes from the September, 2013 meeting:

CWG agreed that changes for this issue should apply only to non-placement forms.

Date: 2013-05-03.00:00:00

Additional note, April, 2013:

Concern was expressed that a pool class might provide an interface for iterating over all the pointers that were given out from the pool, and this usage should be supported.

Date: 2013-03-15.00:00:00

Additional note (March, 2013):

One possibility to allow reasonable optimizations would be to require that allocation packages hide their storage in file-static variables, perhaps by adding wording such as:

Furthermore, p0 shall point to an object distinct from any other object that is accessible outside the implementation of the allocation and deallocation functions.
Date: 2012-09-24.00:00:00

In 6.7.6.5.2 [basic.stc.dynamic.allocation] paragraph 2, allocation functions are constrained to return a pointer that is different from any previously returned pointer that has not been passed to a deallocation function. This does not, for instance, prohibit returning a pointer to storage that is part of another object, for example, a pool of storage. The potential implications of this for aliasing should be spelled out.

(See also issues 1027 and 1116.)

History
Date User Action Args
3022-08-03 00:00:00admincreate
2017-02-06 00:00:00adminsetstatus: drwp -> cd4
2015-05-25 00:00:00adminsetstatus: dr -> drwp
2015-04-13 00:00:00adminsetmessages: + msg5333
2014-11-24 00:00:00adminsetstatus: ready -> dr
2014-03-03 00:00:00adminsetmessages: + msg4802
2014-03-03 00:00:00adminsetstatus: drafting -> ready
2013-10-14 00:00:00adminsetmessages: + msg4619
2013-10-14 00:00:00adminsetstatus: open -> drafting
2013-05-03 00:00:00adminsetmessages: + msg4355
2013-03-18 00:00:00adminsetmessages: + msg4263