MCPcopy Create free account
hub / github.com/bytecodealliance/ComponentizeJS / ReallocFn

Function ReallocFn

embedding/embedding.cpp:461–470  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

459
460namespace componentize::embedding {
461static bool ReallocFn(JSContext *cx, unsigned argc, JS::Value *vp) {
462 JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
463 void *old_ptr = (void *)args[0].toInt32();
464 size_t old_len = args[1].toInt32();
465 size_t align = args[2].toInt32();
466 size_t new_len = args[3].toInt32();
467 void *ptr = cabi_realloc(old_ptr, old_len, align, new_len);
468 args.rval().setInt32((uint32_t)ptr);
469 return true;
470}
471
472void cabi_free(void *ptr) {
473 LOG("(cabi_free) %d", (uint32_t)ptr);

Callers

nothing calls this directly

Calls 1

cabi_reallocFunction · 0.85

Tested by

no test coverage detected