Skip to content

Commit

Permalink
fix: prevent compilers(e.g., Clang on Windows) from optimizing away e…
Browse files Browse the repository at this point in the history
…ssential fetch_add in release mode
  • Loading branch information
jacopodl committed Jun 4, 2024
1 parent 9634f47 commit ceec26a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion argon/vm/memory/refcount.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,11 @@ bool RefCount::IncStrong() {
desired = current;

if (!RC_HAVE_INLINE_COUNTER(desired)) {
assert(RC_GET_SIDETABLE(desired)->strong.fetch_add(1) != 0);
auto *side = RC_GET_SIDETABLE(desired);
auto s_fetch = side->strong.fetch_add(1);

assert(s_fetch != 0);

return true;
}

Expand Down

0 comments on commit ceec26a

Please sign in to comment.