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

Code cleanup in object.c to support future work #1659

Open
wants to merge 1 commit into
base: unstable
Choose a base branch
from

Conversation

SoftlyRaining
Copy link
Contributor

Summary of changes:

  • Define/allocate layout of robj's embedded data in once place instead of two
  • More consistent naming: o to refer to robj, val/ptr/val_ptr to refer to contained value
  • Add static to helpers to clarify scope/usage and improve compiler optimization

My primary goal is to make the structure and memory layout of robj easier to change and work with in the future. This will support future work like eliminating the 8 byte ptr when value is embedded directly, and potentially expand value embedding beyond OBJ_ENCODING_EMBSTR and OBJ_ENCODING_INT.

I'm a bit unsure about the function signature of createObjectWithEmbeddedData - let me know if you have a cleaner idea!

Copy link

codecov bot commented Feb 4, 2025

Codecov Report

Attention: Patch coverage is 95.58824% with 3 lines in your changes missing coverage. Please review.

Project coverage is 71.01%. Comparing base (78bcc0a) to head (fd3e5e7).
Report is 4 commits behind head on unstable.

Files with missing lines Patch % Lines
src/object.c 95.58% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #1659      +/-   ##
============================================
- Coverage     71.02%   71.01%   -0.02%     
============================================
  Files           121      121              
  Lines         65176    65187      +11     
============================================
  Hits          46290    46290              
- Misses        18886    18897      +11     
Files with missing lines Coverage Δ
src/server.h 100.00% <ø> (ø)
src/object.c 82.05% <95.58%> (+0.01%) ⬆️

... and 19 files with indirect coverage changes

…: o to refer to robj, val/ptr/val_ptr to refer to object's value. Add static to helpers

Signed-off-by: Rain Valentine <[email protected]>
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.

1 participant