-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support multiple allocators, add TLSF
allocator and create cmake switches
#83
Draft
EngineersBox
wants to merge
128
commits into
Lameguy64:master
Choose a base branch
from
EngineersBox:multiple-allocators
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
EngineersBox
changed the title
Support multiple allocators and cmake switches
Support multiple allocators, add Feb 7, 2024
TLSF
allocator and create cmake switches
EngineersBox
commented
Feb 11, 2024
EngineersBox
commented
Feb 11, 2024
EngineersBox
commented
Feb 11, 2024
EngineersBox
force-pushed
the
multiple-allocators
branch
3 times, most recently
from
July 29, 2024 12:43
4601449
to
3f98423
Compare
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.
Changes
This adds support for multiple allocator implementations in tandem with a CMake switch
-D PSN00BSDK_LIBC_ALLOCATOR
with the current implementations:To Consider
In order to directly support the TLSF allocator repo, might be better to add it as a submodule with an include wrapper for the necessary coupling to the SDK's expected malloc interface. On the other hand this might not be a good idea, since I plan to cut down the TLSF implementation to only support
32-bit
and change the alignment from4
to8
bytes.I'd imagine that there might be some discussion to be had around the implementation of the CMake side of things. I'm really not overly familiar with CMake so there may well be better ways of doing what I've done in this PR.
Something else to think about is adding performance tests/benchmarking in the form of a standard suite to run against a given allocator implementation. This gives both SDK devs and users a decent idea of how the supported allocators run and their practical usage.
TODO
void TrackHeapUsage(ptrdiff_t alloc_incr)
forTLSF
void GetHeapUsage(HeapUsage* usage)
forTLSF
.TLSF
to a git submodule and create interfacing wrapper (option 1).TLSF
to support only32-bit
and8-byte
alignment (option 2).CUSTOM
one.README.md
.Notes
I've used TLSF before a while ago for an undergrad thesis project and it showed promise over the standard GlibC allocator and will subsequently perform much better than the current implementation in the SDK.