Conversation
This introduces three performance/size tuning knobs:
- TLSF_MAX_POOL_BITS: clamp FL index to reduce tlsf_t control structure
size (e.g. -DTLSF_MAX_POOL_BITS=20 for 1 MB max pool). Runtime guards
in arena_{grow,append_pool} prevent merged block from overflowing the
mapping function.
- TLSF_SPLIT_THRESHOLD: configurable minimum remainder for trimming
(default BLOCK_SIZE_MIN preserves existing behavior). Raising it
avoids tiny free blocks whose metadata overhead exceeds payload.
- Reorder tlsf_t fields: move hot arena/size before the large block[][]
matrix so bitmap scans and pool checks stay in the same cache lines.
FL_COUNT is now computed from FL_MAX and FL_SHIFT rather than hardcoded
per architecture. Static asserts validate all constraints.
WCET Results (x86-64) |
WCET Results (arm64) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This introduces three performance/size tuning knobs:
FL_COUNT is now computed from FL_MAX and FL_SHIFT rather than hardcoded per architecture. Static asserts validate all constraints.
Summary by cubic
Make the allocator size and split behavior configurable at compile time to reduce memory footprint and fragmentation. Defaults keep current behavior, with static and runtime checks to enforce limits.
New Features
Refactors
Written for commit 2c7f75e. Summary will update on new commits.