Expand description
bulk-allocator provides implementations of GlobalAlloc that manage a memory cache.
The instance fetches memory chunks from the backend and frees them on the drop at once for
the performance.
Method dealloc does not instantly free the specified pointer; instead, it pools the pointer
within the cache.
Method alloc acquires a memory chunk from the backend and fill the cache if necessary, and
returns a requested pointer from the cache.
It is when the instance is dropped that the memory chunks are deallocated.
Structs§
- Bulk
Alloc BulkAllocis an implementation ofGlobalAllocholding memory cache. This struct acquires bulk memories from the backend, and frees them on the drop at once for the performance.- Layout
Bulk Alloc LayoutBulkAllocis an implementation ofGlobalAlloc.- Unsafe
Layout Bulk Alloc UnsafeLayoutBulkAllocis an implementation ofGlobalAlloc.
Constants§
- MEMORY_
CHUNK_ SIZE - 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.