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

Function _rpmalloc_span_map_from_reserve

source/extern/rpmalloc.c:1146–1158  ·  view source on GitHub ↗

Use reserved spans to fulfill a memory map request (reserve size must be checked by caller)

Source from the content-addressed store, hash-verified

1144
1145//! Use reserved spans to fulfill a memory map request (reserve size must be checked by caller)
1146static span_t*
1147_rpmalloc_span_map_from_reserve(heap_t* heap, size_t span_count) {
1148 //Update the heap span reserve
1149 span_t* span = heap->span_reserve;
1150 heap->span_reserve = (span_t*)pointer_offset(span, span_count * _memory_span_size);
1151 heap->spans_reserved -= (uint32_t)span_count;
1152
1153 _rpmalloc_span_mark_as_subspan_unless_master(heap->span_reserve_master, span, span_count);
1154 if (span_count <= LARGE_CLASS_COUNT)
1155 _rpmalloc_stat_inc(&heap->span_use[span_count - 1].spans_from_reserved);
1156
1157 return span;
1158}
1159
1160//! Get the aligned number of spans to map in based on wanted count, configured mapping granularity and the page size
1161static size_t

Callers 1

_rpmalloc_span_mapFunction · 0.85

Tested by

no test coverage detected