thomcc / arcstr

Better reference counted strings for Rust
Apache License 2.0
114 stars 18 forks source link

Support creating static `ArcStr`'s at runtime (leaking them) #55

Closed thomcc closed 5 months ago

thomcc commented 5 months ago

I wrote this a while ago, then didn't need it, but it may be useful to others.

The main drawback is that it adds a branch to refcount manipulation, but that should be a wash (the function is already doing atomic RMWs, which are likely more costly than a the branching most of the time).

On the positive side, it makes it so we no longer need to abort on refcount overflow -- we can simply transition the string to static (leak it).

I've also updated some deps and may do a bit of other cleanup while I'm here.

EDIT: this is now mostly cleanup.

codecov-commenter commented 5 months ago

Codecov Report

Attention: Patch coverage is 52.94118% with 48 lines in your changes are missing coverage. Please review.

Project coverage is 83.22%. Comparing base (36dcce9) to head (b05a84b). Report is 1 commits behind head on main.

Files Patch % Lines
src/arc_str.rs 52.94% 48 Missing :warning:

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #55 +/- ## ========================================== - Coverage 92.48% 83.22% -9.27% ========================================== Files 4 4 Lines 386 447 +61 ========================================== + Hits 357 372 +15 - Misses 29 75 +46 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.