ERIS CORE

◆ startVM()

void FLASHMEM AppWren::startVM ( )

start the VM

Definition at line 1444 of file AppWren.cpp.

1444  {
1445  Serial.println(F("\nM AppWren::startVM()"));
1446  WrenConfiguration config;
1447  wrenInitConfiguration(&config);
1448  config.writeFn = &writeFn;
1449  config.errorFn = &errorFn;
1450 #ifdef USE_EXTMEM
1451  config.initialHeapSize = WREN_VM_HEAP_SIZE;
1452  config.minHeapSize = WREN_VM_HEAP_SIZE;
1453  config.heapGrowthPercent = 1;
1454  //config.reallocateFn = &vmReallocate;
1455 #else
1456  config.initialHeapSize = WREN_VM_HEAP_SIZE * 2;
1457  config.minHeapSize = WREN_VM_HEAP_SIZE;
1458  config.heapGrowthPercent = 10;
1459 #endif
1460  config.bindForeignMethodFn = &bindForeignMethod;
1461  config.loadModuleFn = &loadModule;
1462 
1463  vm = wrenNewVM(&config);
1464  wrenEnsureSlots(vm, 4);
1465 }
WrenLoadModuleResult loadModule(WrenVM *vm, const char *name)
callback for the VM to request a module be loaded from the filesystem
Definition: AppWren.cpp:131
static void writeFn(WrenVM *vm, const char *text)
write function system callback for the Wren VM. Stdout/Stderr is Serial
Definition: AppWren.cpp:45
void errorFn(WrenVM *vm, WrenErrorType errorType, const char *module, const int line, const char *msg)
error function system callback for the Wren VM. Stdout/Stderr is Serial
Definition: AppWren.cpp:64
WrenForeignMethodFn FLASHMEM bindForeignMethod(WrenVM *vm, const char *module, const char *className, bool isStatic, const char *signature)
callback function for Wren to request an exported function bindings
Definition: AppWren.cpp:1258
WrenVM * vm
Definition: AppWren.h:780

References bindForeignMethod(), errorFn(), loadModule(), vm, and writeFn().

Referenced by restartVM(), and vmConstructor().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: