firedancer icon indicating copy to clipboard operation
firedancer copied to clipboard

types: add API to determine worst-case heap allocs

Open ripatel-fd opened this issue 9 months ago • 0 comments

For any given type definition and number of bytes, the deserialization requires at most n heap allocations spanning m bytes in the worst case.

fd_types should provide an API that returns this worst-case number for a given number of bytes. The purpose of this API is to allow the caller to ensure that enough heap space is available before attempting to deserialize.

ripatel-fd avatar May 03 '24 10:05 ripatel-fd