Unmap pages from virtual memory
| 1566 | |
| 1567 | //! Unmap pages from virtual memory |
| 1568 | static 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 | |
| 1582 | static FORCEINLINE int |
| 1583 | atomic_cas_ptr(atomicptr_t* dst, void* val, void* ref) { |
no test coverage detected