Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(975)

Unified Diff: third_party/tcmalloc/chromium/src/tests/malloc_extension_c_test.c

Issue 7050034: Merge google-perftools r109 (the current contents of third_party/tcmalloc/vendor) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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) {

Powered by Google App Engine
This is Rietveld 408576698