Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/oxc_allocator/src/pool_fixed_size.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ pub unsafe fn free_fixed_size_allocator(metadata_ptr: NonNull<FixedSizeAllocator
// so going with `Ordering::SeqCst` to be on safe side.
// Deallocation only happens at the end of the whole process, so it shouldn't matter much.
// TODO: Figure out if can use `Ordering::Relaxed`.
let is_double_owned = metadata.is_double_owned.fetch_and(false, Ordering::SeqCst);
let is_double_owned = metadata.is_double_owned.swap(false, Ordering::SeqCst);
if is_double_owned {
return;
}
Expand Down
2 changes: 1 addition & 1 deletion napi/oxlint2/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ fn wrap_run(cb: JsRunCb) -> ExternalLinterCb {
// stored at the pointer returned by `Allocator::fixed_size_metadata_ptr`.
let metadata = unsafe { metadata_ptr.as_ref() };
// TODO: Is `Ordering::SeqCst` excessive here?
let already_sent_to_js = metadata.is_double_owned.fetch_or(true, Ordering::SeqCst);
let already_sent_to_js = metadata.is_double_owned.swap(true, Ordering::SeqCst);

(metadata.id, already_sent_to_js)
};
Expand Down
Loading