| 1 | // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file |
| 2 | // for details. All rights reserved. Use of this source code is governed by a |
| 3 | // BSD-style license that can be found in the LICENSE file. |
| 4 | |
| 5 | #include "platform/globals.h" |
| 6 | |
| 7 | #if defined(PRODUCT) || !defined(DART_USE_TCMALLOC) |
| 8 | |
| 9 | #include "vm/malloc_hooks.h" |
| 10 | |
| 11 | namespace dart { |
| 12 | |
| 13 | void MallocHooks::Init() { |
| 14 | // Do nothing. |
| 15 | } |
| 16 | |
| 17 | void MallocHooks::Cleanup() { |
| 18 | // Do nothing. |
| 19 | } |
| 20 | |
| 21 | bool MallocHooks::ProfilingEnabled() { |
| 22 | return false; |
| 23 | } |
| 24 | |
| 25 | bool MallocHooks::stack_trace_collection_enabled() { |
| 26 | return false; |
| 27 | } |
| 28 | |
| 29 | void MallocHooks::set_stack_trace_collection_enabled(bool enabled) { |
| 30 | // Do nothing. |
| 31 | } |
| 32 | |
| 33 | void MallocHooks::ResetStats() { |
| 34 | // Do nothing. |
| 35 | } |
| 36 | |
| 37 | bool MallocHooks::Active() { |
| 38 | return false; |
| 39 | } |
| 40 | |
| 41 | void MallocHooks::PrintToJSONObject(JSONObject* jsobj) { |
| 42 | // Do nothing. |
| 43 | } |
| 44 | |
| 45 | Sample* MallocHooks::GetSample(const void* ptr) { |
| 46 | return NULL; |
| 47 | } |
| 48 | |
| 49 | intptr_t MallocHooks::allocation_count() { |
| 50 | return 0; |
| 51 | } |
| 52 | |
| 53 | intptr_t MallocHooks::heap_allocated_memory_in_bytes() { |
| 54 | return 0; |
| 55 | } |
| 56 | |
| 57 | } // namespace dart |
| 58 | |
| 59 | #endif // !defined(DART_USE_TCMALLOC) && ... |
| 60 | |