Chromium Code Reviews| Index: runtime/vm/malloc_hooks.cc |
| diff --git a/runtime/vm/malloc_hooks.cc b/runtime/vm/malloc_hooks.cc |
| index 2721000616898ec0915be2bb81cd8c6b45758cd5..36ab5d8ea81f2f447fbd93b648dbf4d3c3dce317 100644 |
| --- a/runtime/vm/malloc_hooks.cc |
| +++ b/runtime/vm/malloc_hooks.cc |
| @@ -161,7 +161,17 @@ class AllocationInfo { |
| // malloc_hook_tests.cc might fail, particularily |
| // StackTraceMallocHookLengthTest. If this value is updated, please make sure |
| // that the MallocHooks test cases pass on all platforms. |
| +#if defined(DEBUG) && defined(HOST_ARCH_X64) |
| static const intptr_t kSkipCount = 6; |
| +#elif defined(DEBUG) && defined(HOST_ARCH_IA32) |
| + static const intptr_t kSkipCount = 5; |
| +#elif !(defined(PRODUCT) || defined(DEBUG)) && \ |
| + (defined(HOST_ARCH_X64) || defined(HOST_ARCH_IA32)) |
| + static const intptr_t kSkipCount = 5; |
| +#else |
| +#error Previously unsupported MallocHooks configuration. New kSkipCount may \ |
| + need to be added. |
| +#endif |
|
siva
2017/03/24 22:51:00
Adding such target #ifs in a common file just make
bkonyi
2017/03/27 17:50:25
Done.
|
| }; |
| @@ -443,7 +453,8 @@ void MallocHooksState::RecordFreeHook(const void* ptr) { |
| if (MallocHooksState::address_map()->Lookup(ptr, &allocation_info)) { |
| MallocHooksState::DecrementHeapAllocatedMemoryInBytes( |
| allocation_info->allocation_size()); |
| - ASSERT(MallocHooksState::address_map()->Remove(ptr)); |
| + bool result = MallocHooksState::address_map()->Remove(ptr); |
| + ASSERT(result); |
| delete allocation_info; |
| } |
| } |