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

[proxy](7/n) proxy array and algorithm headers #722

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

SchrodingerZhu
Copy link
Collaborator

@SchrodingerZhu SchrodingerZhu commented Dec 21, 2024

This patch clears all STL dependency in the core header library.
Stacked on #721

@SchrodingerZhu SchrodingerZhu force-pushed the proxy-array branch 5 times, most recently from 97b2d9a to 2b26c85 Compare December 21, 2024 23:22
@SchrodingerZhu SchrodingerZhu changed the title [proxy](7/n) proxy array headers [proxy](7/n) proxy array and algorithm headers Dec 21, 2024
Comment on lines +20 to +29
constexpr SNMALLOC_FAST_PATH const T& max(const T& a, const T& b)
{
return a < b ? b : a;
}

template<typename T>
constexpr SNMALLOC_FAST_PATH const T& min(const T& a, const T& b)
{
return a < b ? a : b;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Theses are also defined in bits.h could we simplify now?

@@ -156,7 +157,7 @@ namespace snmalloc
*/
SNMALLOC_UNUSED_FUNCTION
static constexpr size_t LargestRegisterSize =
std::max(sizeof(uint64_t), sizeof(void*));
proxy::max(sizeof(uint64_t), sizeof(void*));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this use, then we wouldn't need to vendor std::max/std::min?

Suggested change
proxy::max(sizeof(uint64_t), sizeof(void*));
bits::max(sizeof(uint64_t), sizeof(void*));

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.

2 participants