EVaillant / lockfree-object-pool

Object Pool LockFree in Rust
Boost Software License 1.0
44 stars 2 forks source link

Avoid compare_exhange_weak in linear_page.rs #4

Closed jackkleeman closed 7 months ago

jackkleeman commented 7 months ago

compare_exchange_weak can fail spuriously (ie, even if the values match) on some platforms (in my case arm musl). This leads to a panic as we are assuming that x is not null, but in fact it can be null in the spurious failure case. We can wrap this in a loop and check for this, or we can just use the strong variant as I have here, and let llvm do the loop for us.

EVaillant commented 7 months ago

thanks

EVaillant commented 7 months ago

your pr is in the next release (0.1.5)

jackkleeman commented 7 months ago

thank you for the speedy review @EVaillant !