Closed elazarl closed 3 weeks ago
see #98, cc @s1341
Not all suggestion implemented, so not closing yet.
Note that OnceCell
is not suitable for lazy initialisation of a static that requires thread safety to prevent initialization race, I hence used OnceLock + static
instead, and required 'static
lifetime for Gum
.
To support single threaded cases without requiring a lock, one can consider to accept parametrized lifetime in Module
but IMHO, as Gum
is essentially global state, there's no significant gain.
Module::from_gum
should be renamed to Module::obtain
for consistency.
can you take a look at CI?
can you take a look at CI?
Done, forgot to run clippy.
In order to use the underlying C API global init should be called.
We hence force the creation of Gum to use Module::* functions.
We also use OnceLock instead of lazy_static! as discussed in the issue.