haxe icon indicating copy to clipboard operation
haxe copied to clipboard

Disabled debugchk for array get

Open onehundredfeet opened this issue 2 years ago • 2 comments

Currently, the code is debug checking every array access for non basic types. Most of the other calls in the code to unsafe_cast_to use '~debugchk:false` but array access did not. This was a big hit for tight loops where a check on casting was evaluated in production code.

onehundredfeet avatar Jan 09 '22 06:01 onehundredfeet

This is not so easy. I think I kept it because there's several cases where the type needs to be cast, especially when dealing with interfaces, structures, or polymorphic arrays.

ncannasse avatar Jan 10 '22 12:01 ncannasse

The cast is still there, it's just the debug check that's disabled. Unless, I'm misunderstanding what the flag does.

The debug check seems to just assert when the cast fails. I'd love to hook this up to a compiler flag but it's beyond my ocml atm.

onehundredfeet avatar Jan 10 '22 15:01 onehundredfeet