This repository was archived by the owner on May 3, 2026. It is now read-only.
Releases: bodil/refpool
Releases · bodil/refpool
Release list
0.4.2
0.4.1
0.4.0
CHANGED
PoolRef::clonedhas been made an associated function, to avoid conflicts with wrapped methods. Where you'd previously dopoolref.cloned(pool)you'll now have to doPoolRef::cloned(pool, poolref).
ADDED
- There's now a feature flag
default_implwhich removes thePoolDefaultImpltrait and instead uses specialisation (specifically themin_specializationlanguage feature) to provide default implementations forPoolCloneandPoolDefaultfor any type implementingCloneandDefault. As this needs an unstable language feature to be enabled, it will only work on nightly rustc. PoolBoxandPoolRefnow haveinto_rawandfrom_rawfunctions, plusinto_raw_non_nullforPoolBox, which work similarly to theirBoxandRccounterparts. To accommodate this, the memory layout of the internalRefBoxstructure has changed, so that the pointer stored in aPoolBoxorPoolRefis now guaranteed to point at the boxed value.- There is now a
refpool::fakepoolmodule which provides fake versions ofPool,PoolBoxandPoolRef, the latter two being zero cost wrappers aroundBoxandRc, andPoolbeing a zero sized structure that will optimise away entirely, for situations where you may want to only optionally use the pool but want to write the same code for both situations.
0.3.1
0.3.0
REMOVED
- The
PoolSyncmode has been removed entirely, along with the option to choose which mode to use, asPoolUnsyncis now the only one remaining.PoolSyncpools were too slow to be worthwhile, and I didn't trust the correctness of the threadsafePoolRefimplementation.
0.2.3
0.2.2
ADDED
- You can now
Pool::cast()a pool handle into a pool handle for a different type, allowing you to construct values of multiple types from the same pool, provided they are of the exact same size and alignment. Pools of size 0 are now represented by null pointers, meaning they allocate nothing. It also meansOption<Pool>is no longer identical in size toPool, butPoolRefstill retains that property. APoolof size 0 is also conceptually identical to theNonevalue of anOption<Pool>, except you can use it to construct values without having to unwrap it first, so there's no good reason you should ever needOption<Pool>.
0.2.1
FIXED
PoolandPoolRefnow useNonNullinstead of raw pointers, so that they can be wrapped inOptionwithout growing in size.- Fixed a race condition where the last
PoolRefreferencing a pool might try to drop it before returning its allocation to it, causing a memory fault.
0.2.0
CHANGED
- The pool is now reference counted, which means your
PoolRefs won't suddenly become dangerously invalid when the pool goes out of scope. This also means that you can now clone aPooland get another reference to the same pool.
ADDED
- There are now both
Syncand!Syncversions of the pool. The latter, inrefpool::unsync::Pool, is as performant as previously, while the thread safe version inrefpool::sync::Poolis roughly 5-10x slower, but still manages to be about 25% faster than the Windows system allocator. You should prefer not to use it on platforms with faster system allocators, such as Linux. To enable the thread safe version, use thesyncfeature flag. - A method
Pool::fill()has been added, which preallocates memory chunks to the capacity of the pool.