| 459 | |
| 460 | namespace componentize::embedding { |
| 461 | static 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 | |
| 472 | void cabi_free(void *ptr) { |
| 473 | LOG("(cabi_free) %d", (uint32_t)ptr); |
nothing calls this directly
no test coverage detected