MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / _rpmalloc_unmap

Function _rpmalloc_unmap

source/extern/rpmalloc.c:922–932  ·  view source on GitHub ↗

Unmap virtual memory address is the memory address to unmap, as returned from _memory_map size is the number of bytes to unmap, which might be less than full region for a partial unmap offset is the offset in bytes to the actual mapped region, as set by _memory_map release is set to 0 for partial unmap, or size of entire range for a full unmap

Source from the content-addressed store, hash-verified

920// offset is the offset in bytes to the actual mapped region, as set by _memory_map
921// release is set to 0 for partial unmap, or size of entire range for a full unmap
922static void
923_rpmalloc_unmap(void* address, size_t size, size_t offset, size_t release) {
924 rpmalloc_assert(!release || (release >= size), "Invalid unmap size");
925 rpmalloc_assert(!release || (release >= _memory_page_size), "Invalid unmap size");
926 if (release) {
927 rpmalloc_assert(!(release % _memory_page_size), "Invalid unmap size");
928 _rpmalloc_stat_sub(&_mapped_pages, (release >> _memory_page_size_shift));
929 _rpmalloc_stat_add(&_unmapped_total, (release >> _memory_page_size_shift));
930 }
931 _memory_config.memory_unmap(address, size, offset, release);
932}
933
934//! Default implementation to map new pages to virtual memory
935static void*

Callers 3

_rpmalloc_span_unmapFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected