onflow / atree

Atree provides scalable arrays and scalable ordered maps.
https://onflow.org
Apache License 2.0
39 stars 13 forks source link

Slab size computation needs to be changed for atree inlining #335

Closed fxamacker closed 9 months ago

fxamacker commented 10 months ago

Problem

This isn't a problem yet, but it will surface with atree inlining.

When the same value is reset in Array or OrderedMap and its storable is a pointer, slab size computation can be wrong by simply taking a size diff of existing element and new element. This is because existing and new elements are the same and they returns the same storable size, which results in 0 size diff, even if element content is modified and actual size is different.

Suggestion

Change the way slab size is computed in Set functions to avoid the scenario described.

fxamacker commented 9 months ago

This is closed by PRs #336 and #337.