Skip to content

Commit

Permalink
make evil transmute on collection condition more readable
Browse files Browse the repository at this point in the history
  • Loading branch information
claytonwramsey committed Aug 28, 2024
1 parent 64e6365 commit 6a88e11
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions dumpster/src/sync/collect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,12 @@ pub fn notify_dropped_gc() {
}
});

if (unsafe {
transmute::<_, CollectCondition>(GARBAGE_TRUCK.collect_condition.load(Ordering::Relaxed))
})(&CollectInfo { _private: () })
{
let collect_cond = unsafe {
transmute::<*mut (), CollectCondition>(
GARBAGE_TRUCK.collect_condition.load(Ordering::Relaxed),
)
};
if collect_cond(&CollectInfo { _private: () }) {
GARBAGE_TRUCK.collect_all();
}
}
Expand Down

0 comments on commit 6a88e11

Please sign in to comment.