diff options
Diffstat (limited to 'runtime/openjdkjvmti/events.cc')
| -rw-r--r-- | runtime/openjdkjvmti/events.cc | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/runtime/openjdkjvmti/events.cc b/runtime/openjdkjvmti/events.cc index f38aa869d9..d3f8001d69 100644 --- a/runtime/openjdkjvmti/events.cc +++ b/runtime/openjdkjvmti/events.cc @@ -144,6 +144,18 @@ void EventHandler::RegisterArtJvmTiEnv(ArtJvmTiEnv* env) { envs.push_back(env); } +void EventHandler::RemoveArtJvmTiEnv(ArtJvmTiEnv* env) { + auto it = std::find(envs.begin(), envs.end(), env); + if (it != envs.end()) { + envs.erase(it); + for (size_t i = static_cast<size_t>(ArtJvmtiEvent::kMinEventTypeVal); + i <= static_cast<size_t>(ArtJvmtiEvent::kMaxEventTypeVal); + ++i) { + RecalculateGlobalEventMask(static_cast<ArtJvmtiEvent>(i)); + } + } +} + static bool IsThreadControllable(ArtJvmtiEvent event) { switch (event) { case ArtJvmtiEvent::kVmInit: @@ -200,7 +212,7 @@ class JvmtiAllocationListener : public art::gc::AllocationListener { thread.get(), object.get(), klass.get(), - byte_count); + static_cast<jlong>(byte_count)); } } |