MCPcopy Create free account
hub / github.com/BabylonJS/BabylonNative / RunEnvironmentTier

Method RunEnvironmentTier

Core/AppRuntime/Source/AppRuntimeV8.cpp:45–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43 }
44
45 void AppRuntime::RunEnvironmentTier(const char* executablePath)
46 {
47 // Create the isolate.
48 Module::Initialize(executablePath);
49 v8::Isolate::CreateParams create_params;
50 create_params.array_buffer_allocator = v8::ArrayBuffer::Allocator::NewDefaultAllocator();
51 v8::Isolate* isolate = v8::Isolate::New(create_params);
52
53 // Use the isolate within a scope.
54 {
55 v8::Isolate::Scope isolate_scope{isolate};
56 v8::HandleScope isolate_handle_scope{isolate};
57 v8::Local<v8::Context> context = v8::Context::New(isolate);
58 v8::Context::Scope context_scope{context};
59
60 Napi::Env env = Napi::Attach(context);
61 Run(env);
62 Napi::Detach(env);
63 }
64
65 // Destroy the isolate.
66 // todo : GetArrayBufferAllocator not available?
67 // delete isolate->GetArrayBufferAllocator();
68 isolate->Dispose();
69 }
70}

Callers

nothing calls this directly

Calls 4

AttachFunction · 0.85
DisposeMethod · 0.80
InitializeFunction · 0.50
DetachFunction · 0.50

Tested by

no test coverage detected