Mercurial > hg > graal-jvmci-8
comparison src/share/vm/services/management.cpp @ 20248:009de2b033fc
8029070: memory leak in jmm_SetVMGlobal
Reviewed-by: kvn, dholmes
author | iignatyev |
---|---|
date | Mon, 23 Dec 2013 20:56:18 +0400 |
parents | ce8f6bb717c9 |
children | 966601b12d4f |
comparison
equal
deleted
inserted
replaced
20241:bcd72ab4d91f | 20248:009de2b033fc |
---|---|
1822 if (!flag->is_writeable()) { | 1822 if (!flag->is_writeable()) { |
1823 THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), | 1823 THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), |
1824 "This flag is not writeable."); | 1824 "This flag is not writeable."); |
1825 } | 1825 } |
1826 | 1826 |
1827 bool succeed; | 1827 bool succeed = false; |
1828 if (flag->is_bool()) { | 1828 if (flag->is_bool()) { |
1829 bool bvalue = (new_value.z == JNI_TRUE ? true : false); | 1829 bool bvalue = (new_value.z == JNI_TRUE ? true : false); |
1830 succeed = CommandLineFlags::boolAtPut(name, &bvalue, Flag::MANAGEMENT); | 1830 succeed = CommandLineFlags::boolAtPut(name, &bvalue, Flag::MANAGEMENT); |
1831 } else if (flag->is_intx()) { | 1831 } else if (flag->is_intx()) { |
1832 intx ivalue = (intx)new_value.j; | 1832 intx ivalue = (intx)new_value.j; |
1854 if (str == NULL) { | 1854 if (str == NULL) { |
1855 THROW(vmSymbols::java_lang_NullPointerException()); | 1855 THROW(vmSymbols::java_lang_NullPointerException()); |
1856 } | 1856 } |
1857 ccstr svalue = java_lang_String::as_utf8_string(str); | 1857 ccstr svalue = java_lang_String::as_utf8_string(str); |
1858 succeed = CommandLineFlags::ccstrAtPut(name, &svalue, Flag::MANAGEMENT); | 1858 succeed = CommandLineFlags::ccstrAtPut(name, &svalue, Flag::MANAGEMENT); |
1859 if (succeed) { | |
1860 FREE_C_HEAP_ARRAY(char, svalue, mtInternal); | |
1861 } | |
1859 } | 1862 } |
1860 assert(succeed, "Setting flag should succeed"); | 1863 assert(succeed, "Setting flag should succeed"); |
1861 JVM_END | 1864 JVM_END |
1862 | 1865 |
1863 class ThreadTimesClosure: public ThreadClosure { | 1866 class ThreadTimesClosure: public ThreadClosure { |