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

Fix slab size when resetting mutable storable in OrderedMap #337

Conversation

fxamacker
Copy link
Member

@fxamacker fxamacker commented Sep 4, 2023

Updates #292 #335

Changes

Recompute slab size by adding all element sizes instead of using the size diff of old and new element because oldElem can be the same storable when the same value is reset and oldElem.ByteSize() can equal storable.ByteSize().

Given this, size diff of the old and new element can be 0 even when its actual size changed.

Also extracted map data slab prefix computation to a new function.

This is prep work for atree inlining to prevent a bug from surfacing.


  • 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

Also extracted map data slab prefix computation to a new function.
@codecov-commenter
Copy link

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.04% 🎉

Comparison is base (dda0495) 65.32% compared to head (cc19ec9) 65.36%.

Additional details and impacted files
@@                                        Coverage Diff                                        @@
##           fxamacker/fix-slab-size-when-resetting-same-storable-in-array     #337      +/-   ##
=================================================================================================
+ Coverage                                                          65.32%   65.36%   +0.04%     
=================================================================================================
  Files                                                                 14       14              
  Lines                                                               8773     8784      +11     
=================================================================================================
+ Hits                                                                5731     5742      +11     
  Misses                                                              2325     2325              
  Partials                                                             717      717              
Files Changed Coverage Δ
map.go 67.54% <100.00%> (+0.09%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@fxamacker fxamacker merged commit f4110e8 into fxamacker/fix-slab-size-when-resetting-same-storable-in-array Sep 12, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants