MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / mi_bbitmap_init

Function mi_bbitmap_init

system/lib/mimalloc/src/bitmap.c:1557–1566  ·  view source on GitHub ↗

initialize a bitmap to all unset; avoid a mem_zero if `already_zero` is true returns the size of the bitmap

Source from the content-addressed store, hash-verified

1555// initialize a bitmap to all unset; avoid a mem_zero if `already_zero` is true
1556// returns the size of the bitmap
1557size_t mi_bbitmap_init(mi_bbitmap_t* bbitmap, size_t bit_count, bool already_zero) {
1558 size_t chunk_count;
1559 const size_t size = mi_bbitmap_size(bit_count, &chunk_count);
1560 if (!already_zero) {
1561 _mi_memzero_aligned(bbitmap, size);
1562 }
1563 mi_atomic_store_release(&bbitmap->chunk_count, chunk_count);
1564 mi_assert_internal(mi_atomic_load_relaxed(&bbitmap->chunk_count) <= MI_BITMAP_MAX_CHUNK_COUNT);
1565 return size;
1566}
1567
1568void mi_bbitmap_unsafe_setN(mi_bbitmap_t* bbitmap, size_t idx, size_t n) {
1569 mi_assert_internal(n>0);

Callers 3

mi_meta_page_zallocFunction · 0.85
bitmap.hFile · 0.85
mi_arena_bbitmap_initFunction · 0.85

Calls 2

mi_bbitmap_sizeFunction · 0.85
_mi_memzero_alignedFunction · 0.85

Tested by

no test coverage detected