This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of C++11 status.

1524. Allocation functions are missing happens-before requirements and guarantees

Section: 17.6.3.5 [new.delete.dataraces] Status: C++11 Submitter: Hans Boehm Opened: 2011-02-26 Last modified: 2016-01-28

Priority: Not Prioritized

View all other issues in [new.delete.dataraces].

View all issues with C++11 status.

Discussion:

Addresses US-34

Technical details:

When the same unit of storage is allocated and deallocated repeatedly, operations on it can't be allowed to race between the allocator and the user program. But I don't see any mention of happens-before in the descriptions of allocation and deallocation functions.

Proposed resolution (not wording yet):

[2011-02-26: Hans comments and drafts wording]

The second requirement already exists, almost verbatim, as 17.6.3.5 [new.delete.dataraces] p. 1. I think this is where the statement belongs. However, this paragraph requires work to correctly address the first part of the issue.

[Adopted at Madrid, 2011-03]

Proposed resolution:

Change 17.6.3.5 [new.delete.dataraces] p. 1 as follows:

1 The library versions of operator new and operator delete, user replacement versions of global operator new and operator delete, and the C standard library functions calloc, malloc, realloc, and free shall not introduce data races (6.10.2 [intro.multithread]) as a result of concurrent calls from different threads. Calls to these functions that allocate or deallocate a particular unit of storage shall occur in a single total order, and each such deallocation call shall happen before the next allocation (if any) in this order.