MCPcopy Create free account
hub / github.com/Tencent/MMKV / destroyNativeBuffer

Function destroyNativeBuffer

OpenHarmony/MMKV/src/main/cpp/native_bridge.cpp:1715–1726  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1713}
1714
1715static napi_value destroyNativeBuffer(napi_env env, napi_callback_info info) {
1716 size_t argc = 2;
1717 napi_value args[2] = {nullptr};
1718 NAPI_CALL(napi_get_cb_info(env, info, &argc, args, nullptr, nullptr));
1719
1720 auto ptr = (void*) NValueToUInt64(env, args[0]);
1721 auto size = NValueToUInt32(env, args[1]);
1722 if (ptr != nullptr && size != 0) {
1723 free(ptr);
1724 }
1725 return NAPIUndefined(env);
1726}
1727
1728static napi_value writeValueToNativeBuffer(napi_env env, napi_callback_info info) {
1729 size_t argc = 4;

Callers

nothing calls this directly

Calls 3

NValueToUInt64Function · 0.85
NValueToUInt32Function · 0.85
NAPIUndefinedFunction · 0.85

Tested by

no test coverage detected