DescriptionStatically disallow delete' over heap collection objects.
Explicitly deleting heap-allocated heap collection objects isn't
allowed nor meaningful, the garbage collector handles their lifetimes
precisely. The implementation of 'delete' over these collection objects
delegate to a allocator-trait class's free() method, so by not providing
it for heap collection objects, compilation fails if 'delete' is ever
attempted instantiated & used over these objects.
As MSVC performs method instantiation more eagerly, we're unable to
statically catch such inappropriate uses of 'delete' at compile time.
Rely on a run-time NOTREACHED() instead.
R=
BUG=
Committed: https://crrev.com/47bfa8f726181fcce7265f97727182ee2bdd0283
Cr-Commit-Position: refs/heads/master@{#396788}
Patch Set 1 #Patch Set 2 : remove HeapAllocator::free().. #Patch Set 3 : MSVC compatible #Patch Set 4 : comment improved #Messages
Total messages: 13 (8 generated)
|