#memory #alloc #globalalloc #back-end #allocator

bulk_allocator

Implementations of GlobalAlloc holding memory cache

6 releases (breaking)

0.5.2 Aug 14, 2023
0.5.1 Aug 14, 2023
0.4.1 Feb 25, 2023
0.3.0 Jan 29, 2021
0.1.0 Jul 24, 2020

#137 in Memory management

LGPL-3.0-or-later OR Apache-2.0

110KB
2.5K SLoC

bulk_allocator

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.

License: LGPL-3.0-or-later OR Apache-2.0


lib.rs:

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.

No runtime deps