fn tryPushNode(arena: *ArenaAllocator, node: *Node) PushResult arena: *ArenaAllocatornode: *Node287
288
289
290
291
292
293
294
295
296
297
298
299
300
301fn tryPushNode(arena: *ArenaAllocator, node: *Node) PushResult {
assert(node != node.next);
if (@cmpxchgStrong( // strong because retrying means discarding a fitting node -> expensive
?*Node,
&arena.state.used_list,
node.next,
node,
.release, // syncs with acquire in failure path or `loadFirstNode`
.acquire, // syncs with release in success path
)) |old_node| {
return .{ .failure = old_node };
} else {
return .success;
}
}