< prev index next >

src/hotspot/share/gc/z/zMarkStackAllocator.cpp

Print this page

        

*** 68,78 **** if (new_top > end) { // Not enough space left return 0; } ! const uintptr_t prev_top = Atomic::cmpxchg(new_top, &_top, top); if (prev_top == top) { // Success return top; } --- 68,78 ---- if (new_top > end) { // Not enough space left return 0; } ! const uintptr_t prev_top = Atomic::cmpxchg(&_top, top, new_top); if (prev_top == top) { // Success return top; }
*** 108,119 **** // Expand os::commit_memory_or_exit((char*)_end, expand_size, false /* executable */, "Mark stack space"); // Increment top before end to make sure another // thread can't steal out newly expanded space. ! addr = Atomic::add(size, &_top) - size; ! Atomic::add(expand_size, &_end); return addr; } uintptr_t ZMarkStackSpace::alloc(size_t size) { --- 108,119 ---- // Expand os::commit_memory_or_exit((char*)_end, expand_size, false /* executable */, "Mark stack space"); // Increment top before end to make sure another // thread can't steal out newly expanded space. ! addr = Atomic::add(&_top, size) - size; ! Atomic::add(&_end, expand_size); return addr; } uintptr_t ZMarkStackSpace::alloc(size_t size) {
< prev index next >