dart-sdk/runtime/vm/malloc_hooks.h
Ben Konyi 07852532e3 [ VM ] Additional cleanup in Dart_Initialize and Dart_Cleanup
Change-Id: I6dc02b3d9de16cc176eb97613bc0c7f0bb9b16eb
Reviewed-on: https://dart-review.googlesource.com/77013
Commit-Queue: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
2018-09-28 23:18:59 +00:00

43 lines
1.4 KiB
C++

// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
#ifndef RUNTIME_VM_MALLOC_HOOKS_H_
#define RUNTIME_VM_MALLOC_HOOKS_H_
#include "vm/allocation.h"
#include "vm/globals.h"
namespace dart {
class JSONObject;
class Sample;
// The number of frames that are generated by the malloc hooks and collection
// of the stack trace. These frames are ignored when collecting the stack
// trace for a memory allocation. If this number is incorrect, some tests in
// malloc_hook_tests.cc might fail, particularily
// StackTraceMallocHookLengthTest. If this value is updated, please make sure
// that the MallocHooks test cases pass on all platforms.
extern const intptr_t kSkipCount;
class MallocHooks : public AllStatic {
public:
static void Init();
static void Cleanup();
static bool ProfilingEnabled();
static bool stack_trace_collection_enabled();
static void set_stack_trace_collection_enabled(bool enabled);
static void ResetStats();
static bool Active();
static void PrintToJSONObject(JSONObject* jsobj);
static Sample* GetSample(const void* ptr);
static intptr_t allocation_count();
static intptr_t heap_allocated_memory_in_bytes();
};
} // namespace dart
#endif // RUNTIME_VM_MALLOC_HOOKS_H_