Index: third_party/tcmalloc/chromium/src/tests/malloc_extension_c_test.c |
=================================================================== |
--- third_party/tcmalloc/chromium/src/tests/malloc_extension_c_test.c (revision 88335) |
+++ third_party/tcmalloc/chromium/src/tests/malloc_extension_c_test.c (working copy) |
@@ -72,8 +72,12 @@ |
} |
#endif |
- MallocHook_SetNewHook(&TestNewHook); |
- MallocHook_SetDeleteHook(&TestDeleteHook); |
+ if (!MallocHook_AddNewHook(&TestNewHook)) { |
+ FAIL("Failed to add new hook"); |
+ } |
+ if (!MallocHook_AddDeleteHook(&TestDeleteHook)) { |
+ FAIL("Failed to add delete hook"); |
+ } |
free(malloc(10)); |
free(malloc(20)); |
if (g_new_hook_calls != 2) { |
@@ -82,6 +86,12 @@ |
if (g_delete_hook_calls != 2) { |
FAIL("Wrong number of calls to the delete hook"); |
} |
+ if (!MallocHook_RemoveNewHook(&TestNewHook)) { |
+ FAIL("Failed to remove new hook"); |
+ } |
+ if (!MallocHook_RemoveDeleteHook(&TestDeleteHook)) { |
+ FAIL("Failed to remove delete hook"); |
+ } |
} |
void TestMallocExtension(void) { |