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

Side by Side Diff: third_party/tcmalloc/chromium/src/tcmalloc.cc

Issue 257453002: Fix tc_malloc_skip_new_handler to work togather with heap profiler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 8 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2005, Google Inc. 1 // Copyright (c) 2005, Google Inc.
2 // All rights reserved. 2 // All rights reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are 5 // modification, are permitted provided that the following conditions are
6 // met: 6 // met:
7 // 7 //
8 // * Redistributions of source code must retain the above copyright 8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer. 9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above 10 // * Redistributions in binary form must reproduce the above
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 ATTRIBUTE_SECTION(google_malloc); 262 ATTRIBUTE_SECTION(google_malloc);
263 263
264 // Some non-standard extensions that we support. 264 // Some non-standard extensions that we support.
265 265
266 // This is equivalent to 266 // This is equivalent to
267 // OS X: malloc_size() 267 // OS X: malloc_size()
268 // glibc: malloc_usable_size() 268 // glibc: malloc_usable_size()
269 // Windows: _msize() 269 // Windows: _msize()
270 size_t tc_malloc_size(void* p) __THROW 270 size_t tc_malloc_size(void* p) __THROW
271 ATTRIBUTE_SECTION(google_malloc); 271 ATTRIBUTE_SECTION(google_malloc);
272
273 void* tc_malloc_skip_new_handler(size_t size)
274 ATTRIBUTE_SECTION(google_malloc);
272 } // extern "C" 275 } // extern "C"
273 276
274 277
275 // ----------------------- IMPLEMENTATION ------------------------------- 278 // ----------------------- IMPLEMENTATION -------------------------------
276 279
277 static int tc_new_mode = 0; // See tc_set_new_mode(). 280 static int tc_new_mode = 0; // See tc_set_new_mode().
278 281
279 // Routines such as free() and realloc() catch some erroneous pointers 282 // Routines such as free() and realloc() catch some erroneous pointers
280 // passed to them, and invoke the below when they do. (An erroneous pointer 283 // passed to them, and invoke the below when they do. (An erroneous pointer
281 // won't be caught if it's within a valid span or a stale span for which 284 // won't be caught if it's within a valid span or a stale span for which
(...skipping 1603 matching lines...) Expand 10 before | Expand all | Expand 10 after
1885 *mark = ~allocated_mark; // Distinctively not allocated. 1888 *mark = ~allocated_mark; // Distinctively not allocated.
1886 } 1889 }
1887 1890
1888 static void MarkAllocatedRegion(void* ptr) { 1891 static void MarkAllocatedRegion(void* ptr) {
1889 if (ptr == NULL) return; 1892 if (ptr == NULL) return;
1890 MarkType* mark = GetMarkLocation(ptr); 1893 MarkType* mark = GetMarkLocation(ptr);
1891 *mark = GetMarkValue(ptr, mark); 1894 *mark = GetMarkValue(ptr, mark);
1892 } 1895 }
1893 1896
1894 #endif // TCMALLOC_VALIDATION 1897 #endif // TCMALLOC_VALIDATION
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698