MCPcopy Create free account
hub / github.com/NativeScript/android / TryCallGC

Method TryCallGC

test-app/runtime/src/main/cpp/Runtime.cpp:462–476  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

460}
461
462bool Runtime::TryCallGC() {
463 auto success = m_gcFunc != nullptr;
464 if (success) {
465 success = __sync_bool_compare_and_swap(&m_runGC, true, false);
466 if (success) {
467 auto ctx = m_isolate->GetCurrentContext();
468 auto globalObject = ctx->Global();
469 auto gcFunc = Local<Function>::New(m_isolate, *m_gcFunc);
470 auto maybeResult =
471 gcFunc.As<Function>()->Call(ctx, globalObject, 0, nullptr);
472 DEBUG_WRITE("Induced GC runtimeId=%d", m_id);
473 }
474 }
475 return success;
476}
477
478void Runtime::PassExceptionToJsNative(JNIEnv* env, jobject obj,
479 jthrowable exception, jstring message,

Calls 3

NewFunction · 0.85
GlobalMethod · 0.45
CallMethod · 0.45

Tested by

no test coverage detected