src/hotspot/share/gc/shared/space.cpp
changeset 59252 623722a6aeb9
parent 59154 0c2e1808f800
child 59290 97d13893ec3c
--- a/src/hotspot/share/gc/shared/space.cpp	Mon Nov 25 12:32:40 2019 +0100
+++ b/src/hotspot/share/gc/shared/space.cpp	Mon Nov 25 12:33:15 2019 +0100
@@ -554,7 +554,7 @@
     HeapWord* obj = top();
     if (pointer_delta(end(), obj) >= size) {
       HeapWord* new_top = obj + size;
-      HeapWord* result = Atomic::cmpxchg(new_top, top_addr(), obj);
+      HeapWord* result = Atomic::cmpxchg(top_addr(), obj, new_top);
       // result can be one of two:
       //  the old top value: the exchange succeeded
       //  otherwise: the new value of the top is returned.