jonhoo / flurry

A port of Java's ConcurrentHashMap to Rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fails to build on arm

bk2204 opened this issue · comments

As mentioned in the docs for std::sync::atomic, AtomicI64 isn't portable because not all systems have 64-bit atomics. At least 32-bit ARM, PowerPC, and MIPS do not, and I'd like to both use Flurry and support those architectures (my supported architectures are those of Debian where Rust is available).

Is it possible that the AtomicI64 could be an AtomicIsize here to better accommodate 32-bit platforms?

So, maybe. The problem with doing that is that a 32-bit counter here could much more reasonably overflow. I would potentially recommend falling back to a RwLock<HashMap> on those platforms instead.