Cascaded Multi Size Based Allocators Achiving the 'infinite' space ability as ACE_Malloc
ACE_Malloc memory pool has only one linked list,
so when it has a very long list and has various, random chunk size distribution, the cost of its memory management is great.
In our case, the free API of ACE_Malloc has consumed much CPU time.
So I use the ACE_Cascaded_Dynamic_Cached_Allocator class provided in my previous PR to form a allocator hierarchy with various fixed-size achieving the 'infinite' space ability as ACE_Malloc by a cost of O(1).
Main Design
-
Use size-based allocator to reduce the cost of malloc/free
-
Decrease
ACE_Cascaded_Dynamic_Cached_Allocator's initial_n_chunks constructor parameter according to the hierarchy level, but can be adjusted by a thresholdmin_initial_n_chunksparameter -
Increase
ACE_Cascaded_Dynamic_Cached_Allocator's chunk_size constructor parameter according to the hierarchy level, it will enable bigger chunks can be malloced
Summary by CodeRabbit
-
New Features
- Introduced an advanced, multi-level memory management system that optimizes resource allocation to enhance overall performance and reliability.
-
Tests
- Delivered a comprehensive test suite covering various allocation and deallocation scenarios to ensure robust and consistent system behavior.
- Added a new test entry for the "Allocator Cascaded Test" to the test suite.
Converted to draft as this looks to be in development
For some security reason, the codes has some misspell.
The test case is enriched becuase the bug produced by misspell , Including Cascaded Allocator PR.
The work has completed after yesterday, it can be considered to merge into main repo :)
Please remove the MPC submodule
Please remove the MPC submodule
ok , it's my misoperation
:)
So I use the
ACE_Cascaded_Dynamic_Cached_Allocatorclass provided in my previous PR to form a allocator hierarchy with various fixed-size achiving the 'infinite' space ability asACE_Mallocby a cost of O(1).
Which PR is that? Please add a link.
[...] with various fixed-size achieving the 'infinite' space ability as
ACE_Mallocby a cost of O(1).
Please explain what the phrase "'infinite' space ability" means.
So I use the
ACE_Cascaded_Dynamic_Cached_Allocatorclass provided in my previous PR to form a allocator hierarchy with various fixed-size achiving the 'infinite' space ability asACE_Mallocby a cost of O(1).Which PR is that? Please add a link.
[...] with various fixed-size achieving the 'infinite' space ability as
ACE_Mallocby a cost of O(1).Please explain what the phrase "'infinite' space ability" means.
This allocator can assign memory as ACE_Malloc , can assign various size chunks and assign as many bytes as the OS can permit