New paper: N3536, C++ Sized Deallocation -- Lawrence Crowl

A new WG21 paper is available:

Document number: N3536

Date: 2013-03-05

C++ Sized Deallocation

by Lawrence Crowl

 

Excerpt:

Problem

With C++11, programmers may define a static member function operator delete that takes a size parameter indicating the size of the object to be deleted. The equivalent global operator delete is not available. This omission has unfortunate performance consequences.

Modern memory allocators often allocate in size categories, and, for space efficiency reasons, do not store the size of the object near the object. Deallocation then requires searching for the size category store that contains the object. This search can be expensive, particularly as the search data structures are often not in memory caches.

Solution

Permit implementations and programmers to define sized versions of the global operator delete. The compiler shall call the sized version in preference to the unsized version when the sized version is available.
...

Add a Comment

Comments are closed.

Comments (0)

There are currently no comments on this entry.