onflow / atree

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

Add ByteSize() to TypeInfo interface #328

Closed fxamacker closed 10 months ago

fxamacker commented 11 months ago

Updates #292

Description

This PR adds ByteSize() function in TypeInfo interface, which is used to compute extra data size of inlined registers.

Context

Inlined registers are treated as element and its encoded size must be known at runtime to enforce slab size limits. Since inlined registers are root slabs with extra data, encoded extra data size needs to be computed.


fxamacker commented 11 months ago

Postponing merge (for now) because I found a better approach and am looking into it to see if it works out.

fxamacker commented 10 months ago

Closing this PR because I found a better approach.