@@ -43,14 +43,21 @@ pub use standard::{FixedSizeAllocatorMetadata, free_fixed_size_allocator};
4343
4444/// A thread-safe pool for reusing [`Allocator`] instances to reduce allocation overhead.
4545///
46- /// Uses either a standard or fixed-size allocator pool implementation, depending on Cargo features
47- /// and platform support.
46+ /// Uses either:
47+ /// 1. Standard allocators - suitable for general use.
48+ /// 2. Fixed-size allocators - compatible with raw transfer.
49+ ///
50+ /// Standard allocator pool is created by [`AllocatorPool::new`].
51+ /// Fixed-size allocator pool is created by [`AllocatorPool::new_fixed_size`].
52+ ///
53+ /// Fixed-size allocators are only supported on 64-bit little-endian platforms at present,
54+ /// and require the `fixed_size` Cargo feature to be enabled, and `disable_fixed_size` Cargo feature
55+ /// to not be enabled.
4856#[ repr( transparent) ]
4957pub struct AllocatorPool ( AllocatorPoolInner ) ;
5058
5159/// Inner type of [`AllocatorPool`], holding either a standard or fixed-size allocator pool.
5260enum AllocatorPoolInner {
53- #[ cfg_attr( all( feature = "fixed_size" , not( feature = "disable_fixed_size" ) ) , expect( dead_code) ) ]
5461 Standard ( StandardAllocatorPool ) ,
5562 #[ cfg( all(
5663 feature = "fixed_size" ,
@@ -65,15 +72,7 @@ impl AllocatorPool {
6572 /// Create a new [`AllocatorPool`] for use across the specified number of threads,
6673 /// which uses either standard or fixed-size allocators depending on Cargo features.
6774 pub fn new ( thread_count : usize ) -> AllocatorPool {
68- #[ cfg( all( feature = "fixed_size" , not( feature = "disable_fixed_size" ) ) ) ]
69- {
70- Self :: new_fixed_size ( thread_count)
71- }
72-
73- #[ cfg( not( all( feature = "fixed_size" , not( feature = "disable_fixed_size" ) ) ) ) ]
74- {
75- Self ( AllocatorPoolInner :: Standard ( StandardAllocatorPool :: new ( thread_count) ) )
76- }
75+ Self ( AllocatorPoolInner :: Standard ( StandardAllocatorPool :: new ( thread_count) ) )
7776 }
7877
7978 /// Create a new [`AllocatorPool`] for use across the specified number of threads,
0 commit comments