initialize a bitmap to all unset; avoid a mem_zero if `already_zero` is true returns the size of the bitmap
| 1555 | // initialize a bitmap to all unset; avoid a mem_zero if `already_zero` is true |
| 1556 | // returns the size of the bitmap |
| 1557 | size_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 | |
| 1568 | void mi_bbitmap_unsafe_setN(mi_bbitmap_t* bbitmap, size_t idx, size_t n) { |
| 1569 | mi_assert_internal(n>0); |
no test coverage detected