Closed ibokuri closed 1 year ago
Yeah definitely, the line is unnecessary given BoundedEnumMultiSet
can only stores enums.
So right now, keys aren't freed at all for enum multisets (in visitSeq
), but you have a incoming proposal for an isElementAllocated
method (or something like that which would let us free them properly? Is that correct?
Yeah, keys (values?) for BoundedEnumMultiset
do not need to be freed because the enums returned by visitEnum
as implemented in the repo are stack values. Although this doesn't stop a contrived implementation of visitEnum
from returned a heap-allocated enum. The current correct solution without isElementAllocated
and friends is to always free and force unwrapping the allocator, but this has the (non-critical) drawback I mentioned above. I have filed an proposal regarding isElementAllocated
and isValueAllocated
here: https://github.com/getty-zig/getty/issues/127
@polykernel can I delete this comment?