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

An allocator based on arenas #2042

Merged
merged 7 commits into from
Dec 29, 2018
Merged

Conversation

pleroy
Copy link
Member

@pleroy pleroy commented Dec 28, 2018

No description provided.

base/arena_allocator_test.cpp Outdated Show resolved Hide resolved
base/arena_allocator_test.cpp Outdated Show resolved Hide resolved
TEST_F(ArenaAllocatorTest, Container) {
CHECK_EQ(0, arena_.SpaceUsed());
std::vector<std::string, ArenaAllocator<std::string>> v(1000, allocator_);
CHECK_LT(0, arena_.SpaceUsed());
Copy link
Member

Choose a reason for hiding this comment

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

EXPECT_THAT(arena_.SpaceUsed(), Gt(1000));, this is not std::vector<bool>, at least one byte should have been allocated per object.

Consider also trying an std::vector<std::basic_string<char, ArenaAllocator<char>>, ArenaAllocator<std::basic_string<char, ArenaAllocator<char>>>> and checking that it allocates more.

Sorry, something went wrong.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

Sorry, something went wrong.

@eggrobin eggrobin added the LGTM label Dec 29, 2018
@pleroy pleroy merged commit 15dd0a0 into mockingbirdnest:master Dec 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants