hxcpp icon indicating copy to clipboard operation
hxcpp copied to clipboard

Function types being converted to dynamic types

Open paulsgcross opened this issue 3 years ago • 2 comments

Hxcpp transforms function types into dynamics (shown here). Surely it should be converted into a C++ callback in the traditional sense or Callable?

Using HxScout showed a large object footprint when using function types for callbacks, i.e. var func : Float -> Void; and then calling func(3.0). A 'Float' object was created each frame which then needed to be garbage collected. This incurs a big cost at runtime because any time a callback is required, the garbage collector is clearing up potentially thousands of objects that have been seemingly generated for no reason.

paulsgcross avatar Jun 04 '22 07:06 paulsgcross

I think this is legit issue

RblSb avatar Jun 04 '22 07:06 RblSb

I'm pretty sure this is a duplicate, but I can't immediately find the issue I'm thinking of, so we can let this sit here if you like.

Simn avatar Jun 04 '22 07:06 Simn