-
Notifications
You must be signed in to change notification settings - Fork 23.7k
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
sds size classes - memory optimization #2509
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,8 +46,8 @@ | |
#include <limits.h> | ||
#include <math.h> | ||
|
||
#include "hiredis.h" | ||
#include "sds.h" | ||
#include <hiredis.h> | ||
#include <sds.h> /* use sds.h from hiredis, so that only one set of sds functions will be present in the binary */ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. with the previous code (include with double quotes), the result was that redis-cli uses the inline functions of sds from src/sds.h but uses the non-inline functions of sds from the sds.c implementation inside hiredis. now that these implementations are not the same (different sds headers), this will no longer work! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not making redis-cli just use the (new) Redis versions of sds.[ch]? Because it exchanges SDS strings with hiredis? Thanks. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we can also update the sds.c and sds.h inside hiredis. but i think we should keep the above change. otherwise, if/when there's a difference between the two implementations, redis-cli uses linline functions from one implementation and non-inline functions from the other. please note that i also made a change in the Makefile to reflect that... although the sds.o there was actually unused (seems like the linker simply ignored it) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep your reasoning makes sense to me, I'm wondering if we should switch all the implementations inside Redis to a single one. But I don't remember if the current hiredis implementation was a bit different. For sure if it was different, the difference was only marginal. Maybe as part of this pull request, I'll try to unify at least sds of Redis, Disque, and antirez/sds :-) Cheers. |
||
#include "zmalloc.h" | ||
#include "linenoise.h" | ||
#include "help.h" | ||
|
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.
redis-cli uses hiredis (which comes with its own implementation of sds), no need for sds.o in redis-cli.