-
Notifications
You must be signed in to change notification settings - Fork 942
Adding support for sharing memory between the module and the engine #2472
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
Open
yairgott
wants to merge
24
commits into
valkey-io:unstable
Choose a base branch
from
yairgott:hash_shared
base: unstable
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+466
−196
Open
Changes from 15 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
9ee29c2
fixing test issue
yairgott a9fc017
fixing test issue
yairgott 7dae1e6
addressing unittest issues
yairgott 5d4c16a
addressing unittest issues
yairgott f826960
addressing lint
yairgott 78b90bb
addressing comments
yairgott 6f7f990
renaming, bug fixing and adding unittests
yairgott 848fd6d
unittest fix
yairgott a7a1537
cosmetic change
yairgott 06b6cfc
fixing module tests
yairgott c8a7aac
Merge remote-tracking branch 'upstream/unstable' into hash_shared
yairgott 356891d
fixing comments
yairgott 6913e21
addressing code review comments
82ef7bd
addressing lint
48193e8
addressing unit test failure
38aae4a
Update src/t_hash.c
yairgott 5f65be7
Update src/t_hash.c
yairgott 8224ea6
Update src/server.h
yairgott ed86fa0
Update src/entry.c
yairgott 6d5a45e
addressing comments
2aea44d
addressing code review comments
37a006c
fixing module test
b97667a
addressing code review comments
bf6d7c7
addressing code review comments
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This represents an overloading of the
stringReftype for a different purpose. Should it have a different type?In the original, it represents a reference to a non-owned string used in the t_hash entry. There are ownership considerations to maintain. Elsewhere in this review I suggested the possibility of adding a callback to that struct to avoid coupling with server event capabilities.
In this case, you just need to keep track of a pointer/length pair. I'd recommend a new type, local to
db.c, rather than coupling to the type created for t_hash.EDIT: after looking at the other code, it seems that the
stringReftype is only used internally inentry.c. This should definitely be a separate type, andstringRefshould be removed fromserver.h.Uh oh!
There was an error while loading. Please reload this page.
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.
stringRefis a simple struct which holds a pointer to a string and a length. It's currently used by the hash entry and here but may be used in any other place instead of the pair <const char * str, size_t len>. In a way,stringRefis similar to std::string_view, which is widely used in c++.Can you clarify this statement? The existing code and so the PR changes, do not take ownership of the hash field entries.
stringRefis not specific to t_hash and can be used in any scenario where the pair <const char * str, size_t len> is used.stringRef.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.
It seems that Ran's comment is related.