8186776: use ReleaseStringUTFChars instead of jvmtiDeallocate to release strings
authorsspitsyn
Mon, 28 Aug 2017 00:49:06 -0700
changeset 47021 9f639c395a14
parent 46884 b2c074043e74
child 47022 1d2eb4f23b71
8186776: use ReleaseStringUTFChars instead of jvmtiDeallocate to release strings Summary: Replace jvmtiDeallocate with ReleaseStringUTFChars Reviewed-by: sspitsyn, clanger Contributed-by: groeges@uk.ibm.com
jdk/src/jdk.jdwp.agent/share/native/libjdwp/ModuleReferenceImpl.c
--- a/jdk/src/jdk.jdwp.agent/share/native/libjdwp/ModuleReferenceImpl.c	Wed Aug 16 21:16:30 2017 +0200
+++ b/jdk/src/jdk.jdwp.agent/share/native/libjdwp/ModuleReferenceImpl.c	Mon Aug 28 00:49:06 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -57,7 +57,7 @@
     }
     (void)outStream_writeString(out, name);
     if (name != NULL) {
-        jvmtiDeallocate(name);
+        JNI_FUNC_PTR(env, ReleaseStringUTFChars)(env, namestr, name);
     }
     return JNI_TRUE;
 }