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

Refactor hasPointer for register inlining #327

Merged

Conversation

fxamacker
Copy link
Member

Updates #292

Description

Currently, slab has pointer if any of its element is SlabIDStorable. This will become an issue with register inlining because even though inlined slab is not SlabIDStorable, it can contain SlabIDStorable.

This PR:

  • adds containerStorable interface with hasPointer function
  • delegates each storable to check itself recursively
  • removes keyPointer and valuePointer fields from singleElement struct to simplify code.

  • Targeted PR against main branch
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work
  • Code follows the standards mentioned here
  • Updated relevant documentation
  • Re-reviewed Files changed in the Github PR explorer
  • Added appropriate labels

Currently, slab has pointer if any of its element is SlabIDStorable.
This will become an issue with register inlining because even though
inlined slab is not SlabIDStorable, it can contain SlabIDStorable.

This commit:
- adds containerStorable interface with hasPointer function
- delegates each storable to check itself recursively
- removes keyPointer and valuePointer fields from singleElement struct
to simplify code and save 8 bytes per map element in memory
@fxamacker fxamacker merged commit 402ea64 into main Aug 2, 2023
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants