Index: third_party/tcmalloc/chromium/src/tests/malloc_extension_c_test.c |
diff --git a/third_party/tcmalloc/chromium/src/tests/malloc_extension_c_test.c b/third_party/tcmalloc/chromium/src/tests/malloc_extension_c_test.c |
index e384b764b53d1684213b8891e5eba01ad39d617c..af0e0c165943aafe903551a2a415c4ab2fb0b4e1 100644 |
--- a/third_party/tcmalloc/chromium/src/tests/malloc_extension_c_test.c |
+++ b/third_party/tcmalloc/chromium/src/tests/malloc_extension_c_test.c |
@@ -40,8 +40,8 @@ |
#include <stdio.h> |
#include <stdlib.h> |
#include <stddef.h> /* for size_t */ |
-#include <google/malloc_extension_c.h> |
-#include <google/malloc_hook_c.h> |
+#include <gperftools/malloc_extension_c.h> |
+#include <gperftools/malloc_hook_c.h> |
#define FAIL(msg) do { \ |
fprintf(stderr, "FATAL ERROR: %s\n", msg); \ |
@@ -126,6 +126,14 @@ void TestMallocExtension(void) { |
if (MallocExtension_GetAllocatedSize(x) < 10) { |
FAIL("GetEstimatedAllocatedSize returned a bad value (too small)"); |
} |
+ if (MallocExtension_GetOwnership(x) != MallocExtension_kOwned) { |
+ FAIL("DidAllocatePtr returned a bad value (kNotOwned)"); |
+ } |
+ /* TODO(csilvers): this relies on undocumented behavior that |
+ GetOwnership works on stack-allocated variables. Use a better test. */ |
+ if (MallocExtension_GetOwnership(hist) != MallocExtension_kNotOwned) { |
+ FAIL("DidAllocatePtr returned a bad value (kOwned)"); |
+ } |
free(x); |
} |