Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2005, Google Inc. | 1 // Copyright (c) 2012, Google Inc. |
|
jar (doing other things)
2012/08/01 16:38:19
I think this file is meant to be a snapshot of exa
ramant (doing other things)
2012/08/01 17:04:25
Done.
| |
| 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 |
| 11 // copyright notice, this list of conditions and the following disclaimer | 11 // copyright notice, this list of conditions and the following disclaimer |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 213 // When running under valgrind, our custom malloc is replaced with | 213 // When running under valgrind, our custom malloc is replaced with |
| 214 // valgrind's one and malloc extensions will not work. (Note: | 214 // valgrind's one and malloc extensions will not work. (Note: |
| 215 // callers should be responsible for checking that they are the | 215 // callers should be responsible for checking that they are the |
| 216 // malloc that is really being run, before calling Register. This | 216 // malloc that is really being run, before calling Register. This |
| 217 // is just here as an extra sanity check.) | 217 // is just here as an extra sanity check.) |
| 218 if (!RunningOnValgrind()) { | 218 if (!RunningOnValgrind()) { |
| 219 current_instance = implementation; | 219 current_instance = implementation; |
| 220 } | 220 } |
| 221 } | 221 } |
| 222 | 222 |
| 223 unsigned int MallocExtension::GetBytesAllocatedOnCurrentThread() { | |
| 224 return 0; | |
| 225 } | |
| 226 | |
| 223 // ----------------------------------------------------------------------- | 227 // ----------------------------------------------------------------------- |
| 224 // Heap sampling support | 228 // Heap sampling support |
| 225 // ----------------------------------------------------------------------- | 229 // ----------------------------------------------------------------------- |
| 226 | 230 |
| 227 namespace { | 231 namespace { |
| 228 | 232 |
| 229 // Accessors | 233 // Accessors |
| 230 uintptr_t Count(void** entry) { | 234 uintptr_t Count(void** entry) { |
| 231 return reinterpret_cast<uintptr_t>(entry[0]); | 235 return reinterpret_cast<uintptr_t>(entry[0]); |
| 232 } | 236 } |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 363 C_SHIM(ReleaseToSystem, void, (size_t num_bytes), (num_bytes)); | 367 C_SHIM(ReleaseToSystem, void, (size_t num_bytes), (num_bytes)); |
| 364 C_SHIM(GetEstimatedAllocatedSize, size_t, (size_t size), (size)); | 368 C_SHIM(GetEstimatedAllocatedSize, size_t, (size_t size), (size)); |
| 365 C_SHIM(GetAllocatedSize, size_t, (const void* p), (p)); | 369 C_SHIM(GetAllocatedSize, size_t, (const void* p), (p)); |
| 366 | 370 |
| 367 // Can't use the shim here because of the need to translate the enums. | 371 // Can't use the shim here because of the need to translate the enums. |
| 368 extern "C" | 372 extern "C" |
| 369 MallocExtension_Ownership MallocExtension_GetOwnership(const void* p) { | 373 MallocExtension_Ownership MallocExtension_GetOwnership(const void* p) { |
| 370 return static_cast<MallocExtension_Ownership>( | 374 return static_cast<MallocExtension_Ownership>( |
| 371 MallocExtension::instance()->GetOwnership(p)); | 375 MallocExtension::instance()->GetOwnership(p)); |
| 372 } | 376 } |
| OLD | NEW |