DescriptionAdd run-time CHECK to smoke-test allocator overrides
As part of the refactoring work on the allocator, it emerged that it
would be nice to have a test that ensures that we don't accidentally
break things along the way and not detected that.
This CL adds a runtime CHECK() that verifies that:
- On Windows (non-component build) the shim layer has been
initialized. Concretely this checks that chrome called the shimmed
_heap_init() method and not the one from libcmt.
- On Linux desktop, the malloc symbols are being overridden by tcmalloc
(only when USE_TCMALLOC is defined).
The rationale of this test is: if _heap_init was shimmed there are
very good chances that malloc (& friends) were shimmed as well.
Likewise on Linux for mallopt() <-> malloc().
BUG=564618
Committed: https://crrev.com/be9d6fce01061afde845fd7aa2335e5757d6a421
Cr-Commit-Position: refs/heads/master@{#369007}
Patch Set 1 #Patch Set 2 : add also tcmalloc check #Patch Set 3 : Mac is too cool to have malloc.h in the same place. Meh #
Total comments: 3
Patch Set 4 : use ALLOCATOR_SHIM #Patch Set 5 : mallopt crazyiness #Patch Set 6 : fix comment on mallopt #Patch Set 7 : Rebase #Patch Set 8 : AAAAArgh, inconsistent trailing dot in README.chromium #
Messages
Total messages: 32 (15 generated)
|