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

Remove dict from user-facing API #87

Merged
merged 4 commits into from
Oct 9, 2024
Merged

Conversation

bjosv
Copy link
Collaborator

@bjosv bjosv commented Sep 4, 2024

This PR moves dict.h from include/valkey/ to src/ which mainly affects valkeyClusterNodeIterator.

By making the type valkeyClusterNodeIterator opaque we can hide its content and remove the exposure of the dictIterator.

Fixes #44

@zuiderkwast
Copy link
Collaborator

If we want a stack allocated opaque struct, we need to expose the size but we can define it like

struct valkeyClusterNodeIterator {
    char opaque_data[NODE_ITERATOR_SIZE];
};

With an appropriate comment about not relying on the size...

src/valkeycluster.c Outdated Show resolved Hide resolved
@bjosv bjosv marked this pull request as ready for review September 27, 2024 14:40
@bjosv
Copy link
Collaborator Author

bjosv commented Sep 27, 2024

Not sure if this would be fragile when it comes to using it on new/other platforms with different packing of structs?
WDYT?

src/vkutil.h Outdated Show resolved Hide resolved
Co-authored-by: Michael Grunder <[email protected]>
Signed-off-by: Björn Svensson <[email protected]>
@bjosv bjosv merged commit 432f689 into valkey-io:main Oct 9, 2024
34 checks passed
@bjosv bjosv deleted the make-dict-private branch October 9, 2024 11:40
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

Successfully merging this pull request may close these issues.

Move dict.h from include/ to src/
3 participants