MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / _memory_unmap

Function _memory_unmap

vm/ByteCodeTranslator/src/rpmalloc.c:1568–1580  ·  view source on GitHub ↗

Unmap pages from virtual memory

Source from the content-addressed store, hash-verified

1566
1567//! Unmap pages from virtual memory
1568static void
1569_memory_unmap(void* ptr, size_t page_count) {
1570#if ENABLE_STATISTICS
1571 atomic_add32(&_mapped_pages, -(int32_t)page_count);
1572 atomic_add32(&_unmapped_total, (int32_t)page_count);
1573#endif
1574
1575#ifdef PLATFORM_WINDOWS
1576 VirtualFree(ptr, 0, MEM_RELEASE);
1577#else
1578 munmap(ptr, PAGE_SIZE * page_count);
1579#endif
1580}
1581
1582static FORCEINLINE int
1583atomic_cas_ptr(atomicptr_t* dst, void* val, void* ref) {

Callers 4

_memory_deallocateFunction · 0.85
rpmalloc_finalizeFunction · 0.85

Calls 1

atomic_add32Function · 0.85

Tested by

no test coverage detected