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

Function _mi_segment_huge_page_reset

3rd/mimalloc-2.0.9/src/segment.c:1581–1592  ·  view source on GitHub ↗

reset memory of a huge block from another thread

Source from the content-addressed store, hash-verified

1579#else
1580// reset memory of a huge block from another thread
1581void _mi_segment_huge_page_reset(mi_segment_t* segment, mi_page_t* page, mi_block_t* block) {
1582 MI_UNUSED(page);
1583 mi_assert_internal(segment->kind == MI_SEGMENT_HUGE);
1584 mi_assert_internal(segment == _mi_page_segment(page));
1585 mi_assert_internal(page->used == 1); // this is called just before the free
1586 mi_assert_internal(page->free == NULL);
1587 if (segment->allow_decommit) {
1588 const size_t csize = mi_usable_size(block) - sizeof(mi_block_t);
1589 uint8_t* p = (uint8_t*)block + sizeof(mi_block_t);
1590 _mi_os_decommit(p, csize, &_mi_stats_main); // note: cannot use segment_decommit on huge segments
1591 }
1592}
1593#endif
1594
1595/* -----------------------------------------------------------

Callers 1

_mi_free_block_mtFunction · 0.85

Calls 3

_mi_page_segmentFunction · 0.85
mi_usable_sizeFunction · 0.85
_mi_os_decommitFunction · 0.85

Tested by

no test coverage detected