--- a/src/hotspot/share/services/mallocSiteTable.cpp Wed Jan 03 17:29:20 2018 +0000
+++ b/src/hotspot/share/services/mallocSiteTable.cpp Thu Jan 04 18:18:18 2018 -0500
@@ -147,7 +147,7 @@
if (entry == NULL) return NULL;
// swap in the head
- if (Atomic::cmpxchg(entry, &_table[index], (MallocSiteHashtableEntry*)NULL) == NULL) {
+ if (Atomic::replace_if_null(entry, &_table[index])) {
return entry->data();
}
@@ -259,5 +259,5 @@
}
bool MallocSiteHashtableEntry::atomic_insert(MallocSiteHashtableEntry* entry) {
- return Atomic::cmpxchg(entry, &_next, (MallocSiteHashtableEntry*)NULL) == NULL;
+ return Atomic::replace_if_null(entry, &_next);
}