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 arena allocation size in NewEmptyInternalIterator #4905

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions table/iterator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,6 @@ class EmptyInternalIterator : public InternalIteratorBase<TValue> {
};
} // namespace

Iterator* NewEmptyIterator() {
return new EmptyIterator(Status::OK());
}

Iterator* NewErrorIterator(const Status& status) {
return new EmptyIterator(status);
}
Expand All @@ -180,7 +176,7 @@ InternalIteratorBase<TValue>* NewErrorInternalIterator(const Status& status,
if (arena == nullptr) {
return NewErrorInternalIterator<TValue>(status);
} else {
auto mem = arena->AllocateAligned(sizeof(EmptyIterator));
auto mem = arena->AllocateAligned(sizeof(EmptyInternalIterator<TValue>));
return new (mem) EmptyInternalIterator<TValue>(status);
}
}
Expand All @@ -201,7 +197,7 @@ InternalIteratorBase<TValue>* NewEmptyInternalIterator(Arena* arena) {
if (arena == nullptr) {
return NewEmptyInternalIterator<TValue>();
} else {
auto mem = arena->AllocateAligned(sizeof(EmptyIterator));
auto mem = arena->AllocateAligned(sizeof(EmptyInternalIterator<TValue>));
return new (mem) EmptyInternalIterator<TValue>(Status::OK());
}
}
Expand Down