8269393: store/load order not preserved when handling memory pool due to weakly ordered memory architecture of aarch64

Reviewed-by: thartmann, aph
This commit is contained in:
Damon Fenacci 2023-10-06 09:14:03 +00:00
parent f0d66d1fd3
commit 7162624d70

View File

@ -178,8 +178,13 @@ CodeHeapPool::CodeHeapPool(CodeHeap* codeHeap, const char* name, bool support_us
}
MemoryUsage CodeHeapPool::get_memory_usage() {
size_t used = used_in_bytes();
size_t committed = _codeHeap->capacity();
size_t used;
size_t committed;
{
MutexLocker mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
used = used_in_bytes();
committed = _codeHeap->capacity();
}
size_t maxSize = (available_for_allocation() ? max_size() : 0);
return MemoryUsage(initial_size(), used, committed, maxSize);