Skip to content
This repository was archived by the owner on May 3, 2026. It is now read-only.

Releases: bodil/refpool

0.4.2

Choose a tag to compare

@bodil bodil released this 24 Apr 12:54
v0.4.2
a455b08

ADDED

  • PoolClone now also doesn't erroneously require Default when using the default_impl flag.

0.4.1

Choose a tag to compare

@bodil bodil released this 24 Apr 12:29
v0.4.1
ca9c4f5

ADDED

  • The requirement for PoolClone implementors to also implement PoolDefault has been removed.

0.4.0

Choose a tag to compare

@bodil bodil released this 24 Apr 11:57
v0.4.0
cffc836

CHANGED

  • PoolRef::cloned has been made an associated function, to avoid conflicts with wrapped methods. Where you'd previously do poolref.cloned(pool) you'll now have to do PoolRef::cloned(pool, poolref).

ADDED

  • There's now a feature flag default_impl which removes the PoolDefaultImpl trait and instead uses specialisation (specifically the min_specialization language feature) to provide default implementations for PoolClone and PoolDefault for any type implementing Clone and Default. As this needs an unstable language feature to be enabled, it will only work on nightly rustc.
  • PoolBox and PoolRef now have into_raw and from_raw functions, plus into_raw_non_null for PoolBox, which work similarly to their Box and Rc counterparts. To accommodate this, the memory layout of the internal RefBox structure has changed, so that the pointer stored in a PoolBox or PoolRef is now guaranteed to point at the boxed value.
  • There is now a refpool::fakepool module which provides fake versions of Pool, PoolBox and PoolRef, the latter two being zero cost wrappers around Box and Rc, and Pool being 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

Choose a tag to compare

@bodil bodil released this 23 Apr 20:51
v0.3.1
7d98c19

ADDED

  • There is now a PoolBox which works like Box but uses the pool to allocate.

0.3.0

Choose a tag to compare

@bodil bodil released this 23 Apr 20:51
v0.3.0
987ab84

REMOVED

  • The PoolSync mode has been removed entirely, along with the option to choose which mode to use, as PoolUnsync is now the only one remaining. PoolSync pools were too slow to be worthwhile, and I didn't trust the correctness of the threadsafe PoolRef implementation.

0.2.3

Choose a tag to compare

@bodil bodil released this 07 Jan 00:40

ADDED

  • Pool now implements Debug.

FIXED

  • Option<Pool> and Pool are now once again the same size. Zero sized pools still don't cause any allocations.

0.2.2

Choose a tag to compare

@bodil bodil released this 16 Dec 16:52
v0.2.2
f659f97

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 means Option<Pool> is no longer identical in size to Pool, but PoolRef still retains that property. A Pool of size 0 is also conceptually identical to the None value of an Option<Pool>, except you can use it to construct values without having to unwrap it first, so there's no good reason you should ever need Option<Pool>.

0.2.1

Choose a tag to compare

@bodil bodil released this 12 Dec 17:17
v0.2.1
24c5af6

FIXED

  • Pool and PoolRef now use NonNull instead of raw pointers, so that they can be wrapped in Option without growing in size.
  • Fixed a race condition where the last PoolRef referencing a pool might try to drop it before returning its allocation to it, causing a memory fault.

0.2.0

Choose a tag to compare

@bodil bodil released this 29 Nov 16:18
v0.2.0
d2b7549

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 a Pool and get another reference to the same pool.

ADDED

  • There are now both Sync and !Sync versions of the pool. The latter, in refpool::unsync::Pool, is as performant as previously, while the thread safe version in refpool::sync::Pool is 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 the sync feature flag.
  • A method Pool::fill() has been added, which preallocates memory chunks to the capacity of the pool.

0.1.0

Choose a tag to compare

@bodil bodil released this 26 Nov 00:06
0.1.0

Initial release.