You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am not even sure if the title correctly describes the issue. But it seems to be the case for what I am seeing.
Looking at the stack trace below it seems like the function variable magically becomes null, while it was still usable 2 lines above (function->runFunctionClosure(ctx);)
What I notice is that there is a cpp.vm.Gc.compact() call inside the cppia function. Removing such call seems to fix the problem.
The setup is a bit complex to be isolated. So for now I am going to first describe the setup with text and see if there any insights and I hope it is some obvious gc usage issue. The following logic all happens in the same non-haxe thread:
Haxe is used as a library in a c++ project and it is initialized with:
The text was updated successfully, but these errors were encountered:
kevinresol
changed the title
Calling Gc.compact() in cppia collects the current ScriptCallable?
Calling Gc.compact() in cppia collects the current CppiaClosure/ScriptCallable?
Mar 3, 2025
In nightly haxe/hxcpp I actually get a Critical Error: Bad Allocation while collecting - from finalizer? when I run Gc.compact(). So this makes me curious: what is the correct usage of Gc.compact() within cppia?
I am not even sure if the title correctly describes the issue. But it seems to be the case for what I am seeing.
Looking at the stack trace below it seems like the
function
variable magically becomes null, while it was still usable 2 lines above (function->runFunctionClosure(ctx);
)What I notice is that there is a
cpp.vm.Gc.compact()
call inside the cppia function. Removing such call seems to fix the problem.The setup is a bit complex to be isolated. So for now I am going to first describe the setup with text and see if there any insights and I hope it is some obvious gc usage issue. The following logic all happens in the same non-haxe thread:
Type.createInstance(module.resolveClass(name))
) and a instance method is invoked viaReflect.callMethod
cpp.vm.Gc.compact()
is calledInfo:
macos: 15 (arm64)
haxe: 4.3.6
hxcpp: git (9687509)
The text was updated successfully, but these errors were encountered: