Skip to content

Commit

Permalink
Expose gc_run
Browse files Browse the repository at this point in the history
  • Loading branch information
luboslenco committed Nov 19, 2024
1 parent f855f1a commit dc69589
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions base/sources/plugin_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,11 @@ globalThis.buffer_to_string = buffer_to_string;\

any_array_t *plugin_gc;

void gc_root(void *ptr);
void gc_run();

// These could be auto-generated by alang
VOID_FN(gc_run)
VOID_FN_STR(console_log)
VOID_FN_STR(console_info)
PTR_FN(plugin_create)
Expand Down Expand Up @@ -766,15 +770,14 @@ FN(plugin_api_make_raw_mesh) {
return JS_NewInt64(ctx, (int64_t)mesh);
}

void gc_root(void *ptr);

void plugin_api_init() {
JSValue global_obj = JS_GetGlobalObject(js_ctx);

js_eval(lib);
plugin_gc = any_array_create(0);
gc_root(plugin_gc);

BIND(gc_run, 0);
BIND(console_log, 1);
BIND(console_info, 1);
BIND(plugin_create, 0);
Expand Down

0 comments on commit dc69589

Please sign in to comment.