This commit implements proposal https://github.com/getty-zig/getty/issues/127 to adds allocation check functions
for aggregate access interfaces, namingly the functions isElementAllocated,
isValueAllocated, isPayloadAllocated to the SeqAccess, MapAccess and
VariantAccess interfaces respectively. This allows checking the storage
location of a value deserialized from access methods (e.g., nextKey) and
makes it possible to conditionally free the value only if it is allocated on
the heap. Thus, eliminating the need to unconditionally free values which
in some cases force an allocator to be passed for deserialization even if
no allocation would take place, contravening the principle of least privilege.
This commit implements proposal https://github.com/getty-zig/getty/issues/127 to adds allocation check functions for aggregate access interfaces, namingly the functions
isElementAllocated
,isValueAllocated
,isPayloadAllocated
to the SeqAccess, MapAccess and VariantAccess interfaces respectively. This allows checking the storage location of a value deserialized from access methods (e.g.,nextKey
) and makes it possible to conditionally free the value only if it is allocated on the heap. Thus, eliminating the need to unconditionally free values which in some cases force an allocator to be passed for deserialization even if no allocation would take place, contravening the principle of least privilege.closes https://github.com/getty-zig/getty/issues/127