Skip to content
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

Refactor: Remove unused features and functions, and move most allocator operations to a global namespace. #750

Merged
merged 19 commits into from
Feb 22, 2025

Conversation

mjp41
Copy link
Member

@mjp41 mjp41 commented Feb 14, 2025

Three main changes:

  • Removing pass through, as VeronaRT can do this more cleanly now
  • Adding a Config into the snmalloc namespace rather than it being implicit on Alloc::Config. This also makes Alloc a derived concept.
  • Reducing the number of functions that are on the allocator, and moving them to the global snmalloc namespace. E.g. the instance method: snmalloc::Alloc::alloc, becomes snmalloc::alloc.

A lot of this refactoring is to make changing the structure stored in the TLS easier, by moving a lot of the logic out of localalloc.h, which will go away in a subsequent refactor for the TLS.

mjp41 added 11 commits February 14, 2025 13:47
Instead of using snmalloc::Alloc::Config, expose snmalloc::Config, which is then used to derive the allocator type.
VeronaRT now has an abstraction layer which can easily replace the allocator.
Having such a complex integration still in snmalloc does not make sense.
Performing a comparison on two atomic ptr is a complex operation, and should not be implicit.  The memory model order and such things needs to be considered by the caller.
The implementation prefers to use templates over the function_ref.  This now only exists in the Pal for a currently unused feature.
@mjp41 mjp41 changed the title Refactor Refactor: Remove unused features and functions. Feb 14, 2025
@mjp41 mjp41 requested review from nwf and SchrodingerZhu February 14, 2025 21:00
This commit introduces various inline functions on snmalloc:: that perform allocation/deallocation using the thread local allocator.

They remove all usage from a particular test.
@mjp41 mjp41 changed the title Refactor: Remove unused features and functions. Refactor: Remove unused features and functions, and move most allocator operations to a global namespace. Feb 19, 2025
@mjp41
Copy link
Member Author

mjp41 commented Feb 19, 2025

Best to review using individual commits as each one is a fairly self contained change, but the combination is quite large. @nwf I have learnt from you ;-)

@mjp41 mjp41 merged commit 5f7baef into microsoft:main Feb 22, 2025
83 checks passed
@mjp41 mjp41 deleted the refactor branch February 22, 2025 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant