equal
deleted
inserted
replaced
253 if (new_top > end()) { |
253 if (new_top > end()) { |
254 // Not enough space left |
254 // Not enough space left |
255 return 0; |
255 return 0; |
256 } |
256 } |
257 |
257 |
258 const uintptr_t prev_top = Atomic::cmpxchg(new_top, &_top, addr); |
258 const uintptr_t prev_top = Atomic::cmpxchg(&_top, addr, new_top); |
259 if (prev_top == addr) { |
259 if (prev_top == addr) { |
260 // Success |
260 // Success |
261 return ZAddress::good(addr); |
261 return ZAddress::good(addr); |
262 } |
262 } |
263 |
263 |
297 if (new_top != offset) { |
297 if (new_top != offset) { |
298 // Failed to undo allocation, not the last allocated object |
298 // Failed to undo allocation, not the last allocated object |
299 return false; |
299 return false; |
300 } |
300 } |
301 |
301 |
302 const uintptr_t prev_top = Atomic::cmpxchg(new_top, &_top, old_top); |
302 const uintptr_t prev_top = Atomic::cmpxchg(&_top, old_top, new_top); |
303 if (prev_top == old_top) { |
303 if (prev_top == old_top) { |
304 // Success |
304 // Success |
305 return true; |
305 return true; |
306 } |
306 } |
307 |
307 |