Namespaces
Variants
Views
Actions

Difference between revisions of "Template:cpp/memory/thread safety note"

From cppreference.com
(add std::free)
m (align comma position)
Line 4: Line 4:
 
* The library versions of {{ltt|cpp/memory/new/operator_new|operator new}} and {{ltt|cpp/memory/new/operator_delete|operator delete}}
 
* The library versions of {{ltt|cpp/memory/new/operator_new|operator new}} and {{ltt|cpp/memory/new/operator_delete|operator delete}}
 
* User replacement versions of global {{ltt|cpp/memory/new/operator_new|operator new}} and {{ltt|cpp/memory/new/operator_delete|operator delete}}
 
* User replacement versions of global {{ltt|cpp/memory/new/operator_new|operator new}} and {{ltt|cpp/memory/new/operator_delete|operator delete}}
* {{lc|std::calloc}}, {{lc|std::malloc}}, {{lc|std::realloc}}{{rev inl|since=c++17|, {{lc|std::aligned_alloc}}}}, {{lc|std::free}}
+
* {{lc|std::calloc}}, {{lc|std::malloc}}, {{lc|std::realloc}}, {{rev inl|since=c++17| {{lc|std::aligned_alloc}}}}, {{lc|std::free}}
  
 
Calls to these functions that allocate or deallocate a particular unit of storage occur in a single total order, and each such deallocation call [[cpp/atomic/memory_order|happens-before]] the next allocation (if any) in this order.
 
Calls to these functions that allocate or deallocate a particular unit of storage occur in a single total order, and each such deallocation call [[cpp/atomic/memory_order|happens-before]] the next allocation (if any) in this order.
 
}}
 
}}
 
{{rev end}}
 
{{rev end}}

Revision as of 18:58, 13 August 2021

The following functions are required to be thread-safe:

Calls to these functions that allocate or deallocate a particular unit of storage occur in a single total order, and each such deallocation call happens-before the next allocation (if any) in this order.

(since C++11)