On HashLink, Bytes is directly used as a structure for an instance of haxe.io.Bytes, unlike in HXCPP where these are instantiated from a passed value parameter, the problem is that only in the latter this allows the allocated buffer to be disposed when no longer in use. From my understanding, it was presumed that simply assigning the address to b would allow it to be tracked by the GC, which according to this is incorrect.
This is not only theory; when profiling an application, I've observed unfreed memory coming from the function.
On HashLink,
Bytesis directly used as a structure for an instance ofhaxe.io.Bytes, unlike in HXCPP where these are instantiated from a passedvalueparameter, the problem is that only in the latter this allows the allocated buffer to be disposed when no longer in use. From my understanding, it was presumed that simply assigning the address tobwould allow it to be tracked by the GC, which according to this is incorrect.This is not only theory; when profiling an application, I've observed unfreed memory coming from the function.