MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / _mi_os_reset

Function _mi_os_reset

3rd/mimalloc-2.0.9/src/os.c:1075–1079  ·  view source on GitHub ↗

Signal to the OS that the address range is no longer in use but may be used later again. This will release physical memory pages and reduce swapping while keeping the memory committed. We page align to a conservative area inside the range to reset.

Source from the content-addressed store, hash-verified

1073// pages and reduce swapping while keeping the memory committed.
1074// We page align to a conservative area inside the range to reset.
1075bool _mi_os_reset(void* addr, size_t size, mi_stats_t* tld_stats) {
1076 MI_UNUSED(tld_stats);
1077 mi_stats_t* stats = &_mi_stats_main;
1078 return mi_os_resetx(addr, size, true, stats);
1079}
1080
1081/*
1082bool _mi_os_unreset(void* addr, size_t size, bool* is_zero, mi_stats_t* tld_stats) {

Callers 2

_mi_mem_resetFunction · 0.85
mi_segment_page_clearFunction · 0.85

Calls 1

mi_os_resetxFunction · 0.85

Tested by

no test coverage detected