| 1700 | } |
| 1701 | |
| 1702 | static napi_value createNativeBuffer(napi_env env, napi_callback_info info) { |
| 1703 | size_t argc = 1; |
| 1704 | napi_value args[1] = {nullptr}; |
| 1705 | NAPI_CALL(napi_get_cb_info(env, info, &argc, args, nullptr, nullptr)); |
| 1706 | |
| 1707 | auto size = NValueToUInt32(env, args[0]); |
| 1708 | if (size != 0) { |
| 1709 | auto ptr = malloc(size); |
| 1710 | return UInt64ToNValue(env, (uintptr_t) ptr); |
| 1711 | } |
| 1712 | return NAPIUndefined(env); |
| 1713 | } |
| 1714 | |
| 1715 | static napi_value destroyNativeBuffer(napi_env env, napi_callback_info info) { |
| 1716 | size_t argc = 2; |
nothing calls this directly
no test coverage detected