MCPcopy Create free account
hub / github.com/WasmEdge/WasmEdge / release

Method release

lib/system/allocator.cpp:112–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

110}
111
112WASMEDGE_EXPORT void Allocator::release(uint8_t *Pointer, uint64_t) noexcept {
113#if WASMEDGE_OS_WINDOWS
114 winapi::VirtualFree(Pointer - k4G, 0, winapi::MEM_RELEASE_);
115#elif defined(HAVE_MMAP) && (defined(__x86_64__) || defined(__aarch64__) || \
116 (defined(__riscv) && __riscv_xlen == 64)) || \
117 defined(__s390x__)
118 if (Pointer == nullptr) {
119 return;
120 }
121 munmap(Pointer - k4G, k12G);
122#else
123 return std::free(Pointer);
124#endif
125}
126
127uint8_t *Allocator::allocate_chunk(uint64_t Size) noexcept {
128#if WASMEDGE_OS_WINDOWS

Callers 1

MMapMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected