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

Question: Each KV pair has 2 copies in arena? #1148

Open
azuredream opened this issue Sep 30, 2023 · 0 comments
Open

Question: Each KV pair has 2 copies in arena? #1148

azuredream opened this issue Sep 30, 2023 · 0 comments

Comments

@azuredream
Copy link

I'm a C++ beginner, please correct me if I was wrong.
Is it possible to save a pointer to Key rather than a Key object in node?

First copy:
MemTable::Add(): char* buf = arena_.Allocate(encoded_len);

Second copy:
template <typename Key, class Comparator>
struct SkipList<Key, Comparator>::Node {
explicit Node(const Key& k) : key(k) {}

Key const key;
...
}

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

No branches or pull requests

1 participant