-
Notifications
You must be signed in to change notification settings - Fork 4
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
[feat]: add custom allocator #29
base: main-lantern
Are you sure you want to change the base?
[feat]: add custom allocator #29
Conversation
|
||
// Compare two allocators for equality (always true for stateless allocators) | ||
template<typename other_element_at> | ||
bool operator==(const custom_allocator_gt<other_element_at>&) const noexcept { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these are just operators to conform c++'s requirement for an allocator
Hey @Ngalstyan4, would you be a lamb and check out this PR for me? |
Hi @broccoliSpicy , thanks for the contribution! It might also be useful to look at pgv8 postgres extension for how to deal with cpp allocations in a postgres context Thanks again for your contributions! |
passing the allocation functions from C as for checking pgv8, I am sorry that I am having final projects and final exams this week, but I will definitely check it out in next week. |
I checked pgv8, I think their cpp |
This PR tries to add a class custom_allocator_gt so we can pass different allocation/free function pointers to usearch.
lantern issue #147
for discussion only, just a draft to set the direction.
todo: how much performance benefits we can get if we use a aligned allocator(palloc_aligned())