avoid unnecessary bitmap SHM resize

This commit is contained in:
Sergej Schumilo 2023-08-03 12:00:50 +02:00
parent a09d3ae2e6
commit 874fa033d1

View File

@ -121,6 +121,11 @@ static void resize_coverage_bitmap(uint32_t new_bitmap_size)
{ {
uint32_t new_bitmap_shm_size = new_bitmap_size; uint32_t new_bitmap_shm_size = new_bitmap_size;
/* check if we really need to resize the shared memory buffer */
if (new_bitmap_size == GET_GLOBAL_STATE()->shared_bitmap_size) {
return;
}
if (new_bitmap_shm_size % 64 > 0) { if (new_bitmap_shm_size % 64 > 0) {
new_bitmap_shm_size = ((new_bitmap_shm_size + 64) >> 6) << 6; new_bitmap_shm_size = ((new_bitmap_shm_size + 64) >> 6) << 6;
} }