Crate bulk_allocator
source ·Expand description
bulk-allocator provides implementations of GlobalAlloc
holding memory cache.
The instance acquires memory chunks from the backend and frees them on the drop at once for
the performance.
Method dealloc
does not free the specified pointer immediately, but pools in the cache.
Method alloc
acquires a memory chunk from the backend and stores into the cache if the cache
is empty, and then pops and returns a pointer from the cache.
It is when the instance is dropped that the memory chunks are deallocated.
Structs
BulkAlloc
is an implementation ofGlobalAlloc
holding memory cache. This struct acquires bulk memories from the backend, and frees them on the drop at once for the performance.LayoutBulkAlloc
is an implementation ofGlobalAlloc
.UnsafeLayoutBulkAlloc
is an implementation ofGlobalAlloc
.
Constants
- The default byte count of the bulk memory that this crate allocates from the backend if no cache is. Note that if too large layout is requested, it may exceed this value that this crate acquires via the backend.