Mercurial > hg > graal-compiler
diff src/share/vm/prims/jvm.cpp @ 360:5d254928c888
Merge
author | ysr |
---|---|
date | Wed, 27 Aug 2008 11:20:46 -0700 |
parents | 1ee8caae33af |
children | f008d3631bd1 |
line wrap: on
line diff
--- a/src/share/vm/prims/jvm.cpp Wed Aug 27 10:56:33 2008 -0700 +++ b/src/share/vm/prims/jvm.cpp Wed Aug 27 11:20:46 2008 -0700 @@ -377,7 +377,11 @@ JVM_ENTRY_NO_ENV(jlong, JVM_FreeMemory(void)) JVMWrapper("JVM_FreeMemory"); CollectedHeap* ch = Universe::heap(); - size_t n = ch->capacity() - ch->used(); + size_t n; + { + MutexLocker x(Heap_lock); + n = ch->capacity() - ch->used(); + } return convert_size_t_to_jlong(n); JVM_END