Fix ChangeType() to do thread-safe memory clear.
This is important because trying to clear the memory after changing
the type can lead to data races where another thread finds the block
using the new type and tries to use it while the clearing of memory
is still going on.
The code to do this already existed as part of the "object" interface.
This just moves into the lower-level ChangeType method.
Also, clean up the object interface. All of the methods have been
grouped together and their names changed to match those of standard
C++ objects. But other than the memset being removed (to ChangeType),
their operation is unchanged.
BUG=546019
Review-Url: https://codereview.chromium.org/2685723003
Cr-Commit-Position: refs/heads/master@{#449399}
8 files changed