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

Fix GCMapAllocator not being used #369

Merged
merged 3 commits into from
May 5, 2023

Conversation

seanfarley
Copy link
Contributor

@seanfarley seanfarley commented Apr 25, 2023

Previously, the GCMapAllocator specified the wrong template arguments and, thus, would not actually be used. This can be verified by the fact that GCMapAllocator::deallocate used an undefined symbol: seq_gc_free.

C++20 makes this an error like so:

error: static assertion failed due to requirement 'is_same<GCMapAllocator<std::pair<seq_str_t, long long>, re2::RE2>, GCMapAllocator<std::pair<const std::pair<seq_str_t, long long>, re2::RE2>, re2::RE2>>::value': [allocator.requirements] states that rebinding an allocator to the same type should result in the original allocator
    static_assert(is_same<allocator_type, __rebind_alloc<__alloc_traits, value_type> >::value,
    ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3 errors generated.

This patch fixes the undefined symbol of seq_gc_free with seq_free along with fixing <Key, Value> -> <std::pair<Key, Value>>.

@cla-bot
Copy link

cla-bot bot commented Apr 25, 2023

Thank you for your pull request. We require contributors to agree to our Contributor License Agreement (https://exaloop.io/cla.txt), and we don't have @seanfarley on file. In order for us to review and merge your code, please email info@exaloop.io to get yourself added.

@cla-bot
Copy link

cla-bot bot commented Apr 25, 2023

Thank you for your pull request. We require contributors to agree to our Contributor License Agreement (https://exaloop.io/cla.txt), and we don't have @seanfarley on file. In order for us to review and merge your code, please email info@exaloop.io to get yourself added.

@arshajii
Copy link
Contributor

Should be able to run the CI now...

Previously, the GCMapAllocator specified the wrong template arguments
and, thus, would not actually be used. This can be verified by the fact
that `GCMapAllocator::deallocate` used an undefined symbol:
`seq_gc_free`.

C++20 makes this an error like so:

```
error: static assertion failed due to requirement 'is_same<GCMapAllocator<std::pair<seq_str_t, long long>, re2::RE2>, GCMapAllocator<std::pair<const std::pair<seq_str_t, long long>, re2::RE2>, re2::RE2>>::value': [allocator.requirements] states that rebinding an allocator to the same type should result in the original allocator
    static_assert(is_same<allocator_type, __rebind_alloc<__alloc_traits, value_type> >::value,
    ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3 errors generated.
```

This patch fixes the undefined symbol of `seq_gc_free` with `seq_free`
along with fixing `<Key, Value>` -> `<std::pair<Key, Value>>`.
@seanfarley seanfarley force-pushed the cxx-allocator-fix branch from 42ad9ab to 4d5410a Compare May 2, 2023 18:10
@seanfarley
Copy link
Contributor Author

I just pushed a small fixup for compiling on linux (I think an issue with libstdc+). Sorry for missing this the first time.

@arshajii
Copy link
Contributor

arshajii commented May 5, 2023

Thanks @seanfarley! I'll go ahead and merge this.

@arshajii arshajii merged commit fb46137 into exaloop:develop May 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants