| OLD | NEW |
| 1 // Copyright (c) 2000, Google Inc. | 1 // Copyright (c) 2000, 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 1399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1410 void *p = do_debug_memalign_or_debug_cpp_memalign(pagesize, size); | 1410 void *p = do_debug_memalign_or_debug_cpp_memalign(pagesize, size); |
| 1411 MallocHook::InvokeNewHook(p, size); | 1411 MallocHook::InvokeNewHook(p, size); |
| 1412 return p; | 1412 return p; |
| 1413 } | 1413 } |
| 1414 | 1414 |
| 1415 // malloc_stats just falls through to the base implementation. | 1415 // malloc_stats just falls through to the base implementation. |
| 1416 extern "C" PERFTOOLS_DLL_DECL void tc_malloc_stats(void) __THROW { | 1416 extern "C" PERFTOOLS_DLL_DECL void tc_malloc_stats(void) __THROW { |
| 1417 BASE_MALLOC_STATS(); | 1417 BASE_MALLOC_STATS(); |
| 1418 } | 1418 } |
| 1419 | 1419 |
| 1420 extern "C" PERFTOOLS_DLL_DECL void tc_try_malloc(size_t size) __THROW { |
| 1421 return do_malloc(size); |
| 1422 } |
| 1423 |
| 1420 extern "C" PERFTOOLS_DLL_DECL int tc_mallopt(int cmd, int value) __THROW { | 1424 extern "C" PERFTOOLS_DLL_DECL int tc_mallopt(int cmd, int value) __THROW { |
| 1421 return BASE_MALLOPT(cmd, value); | 1425 return BASE_MALLOPT(cmd, value); |
| 1422 } | 1426 } |
| 1423 | 1427 |
| 1424 #ifdef HAVE_STRUCT_MALLINFO | 1428 #ifdef HAVE_STRUCT_MALLINFO |
| 1425 extern "C" PERFTOOLS_DLL_DECL struct mallinfo tc_mallinfo(void) __THROW { | 1429 extern "C" PERFTOOLS_DLL_DECL struct mallinfo tc_mallinfo(void) __THROW { |
| 1426 return BASE_MALLINFO(); | 1430 return BASE_MALLINFO(); |
| 1427 } | 1431 } |
| 1428 #endif | 1432 #endif |
| 1429 | 1433 |
| 1430 extern "C" PERFTOOLS_DLL_DECL size_t tc_malloc_size(void* ptr) __THROW { | 1434 extern "C" PERFTOOLS_DLL_DECL size_t tc_malloc_size(void* ptr) __THROW { |
| 1431 return MallocExtension::instance()->GetAllocatedSize(ptr); | 1435 return MallocExtension::instance()->GetAllocatedSize(ptr); |
| 1432 } | 1436 } |
| OLD | NEW |