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

Function _rpmalloc_span_align_count

source/extern/rpmalloc.c:1161–1167  ·  view source on GitHub ↗

Get the aligned number of spans to map in based on wanted count, configured mapping granularity and the page size

Source from the content-addressed store, hash-verified

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
1162_rpmalloc_span_align_count(size_t span_count) {
1163 size_t request_count = (span_count > _memory_span_map_count) ? span_count : _memory_span_map_count;
1164 if ((_memory_page_size > _memory_span_size) && ((request_count * _memory_span_size) % _memory_page_size))
1165 request_count += _memory_span_map_count - (request_count % _memory_span_map_count);
1166 return request_count;
1167}
1168
1169//! Setup a newly mapped span
1170static void

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected