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
Correct the actual allocated size from allocator when call sdsRedize to align the logic with sdsnewlen function. #476
Conversation
1a73354
to
9b30c8a
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## unstable #476 +/- ##
=========================================
Coverage 69.84% 69.84%
=========================================
Files 109 109
Lines 61797 61801 +4
=========================================
+ Hits 43160 43163 +3
- Misses 18637 18638 +1
|
Right, I did very similar changes. Didn't push yet. |
Signed-off-by: Lipeng Zhu <lipeng.zhu@intel.com>
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 looks good to me, can you move the tests to the new framework?
Signed-off-by: Lipeng Zhu <lipeng.zhu@intel.com>
Done. |
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.
A nice to have, but not necessarily in the scope of this PR, is we should probably add more checks that sdsalloc()
is actually always equal to the underlying zmalloc allocation size.
Just to clarify, underlying allocation size equals to |
@lipzhu A test started to fail after we merged this change related to allocated size: It's the libc malloc function, let me know if you think it's related and if you can try to fix it. |
…to align the logic with sdsnewlen function. (valkey-io#476) This patch try to correct the actual allocated size from allocator when call sdsRedize to align the logic with sdsnewlen function. Maybe the valkey-io#453 optimization should depend on this. Signed-off-by: Lipeng Zhu <lipeng.zhu@intel.com>
@madolson Sure, I will take a look and try to reproduce in local. |
This patch try to correct the actual allocated size from allocator
when call sdsRedize to align the logic with sdsnewlen function.
Maybe the #453 optimization should depend on this.