blob: 570dd0c6ce29d792ad0db8461970ab5db8170def [file] [log] [blame]
Andreas Gampee54d9922016-10-11 19:55:37 -07001/*
2 * Copyright (C) 2016 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Andreas Gampeba8df692016-11-01 10:30:44 -070017#ifndef ART_RUNTIME_OPENJDKJVMTI_TI_HEAP_H_
18#define ART_RUNTIME_OPENJDKJVMTI_TI_HEAP_H_
Andreas Gampee54d9922016-10-11 19:55:37 -070019
20#include "jvmti.h"
21
22namespace openjdkjvmti {
23
24class ObjectTagTable;
25
26class HeapUtil {
27 public:
28 explicit HeapUtil(ObjectTagTable* tags) : tags_(tags) {
29 }
30
Andreas Gampeaa8b60c2016-10-12 12:51:25 -070031 jvmtiError GetLoadedClasses(jvmtiEnv* env, jint* class_count_ptr, jclass** classes_ptr);
32
Andreas Gampee54d9922016-10-11 19:55:37 -070033 jvmtiError IterateThroughHeap(jvmtiEnv* env,
34 jint heap_filter,
35 jclass klass,
36 const jvmtiHeapCallbacks* callbacks,
37 const void* user_data);
38
Andreas Gampe8da6d032016-10-31 19:31:03 -070039 static jvmtiError ForceGarbageCollection(jvmtiEnv* env);
40
Andreas Gampee54d9922016-10-11 19:55:37 -070041 ObjectTagTable* GetTags() {
42 return tags_;
43 }
44
45 private:
46 ObjectTagTable* tags_;
47};
48
49} // namespace openjdkjvmti
50
Andreas Gampeba8df692016-11-01 10:30:44 -070051#endif // ART_RUNTIME_OPENJDKJVMTI_TI_HEAP_H_