提交 bf924e8e 编写于 作者: P Peter Krempa

util: bitmap: Fix value of 'map_alloc' when shrinking bitmap

The virBitmap code uses VIR_RESIZE_N to do quadratic scaling, which
means that along with the number of requested map elements we also need
to keep the number of actually allocated elements for the scaling
algorithm to work properly.

The shrinking code did not fix 'map_alloc' thus virResizeN might
actually not expand the bitmap properly after called on a previously
shrunk bitmap.
上级 cdfc3d7c
......@@ -1317,5 +1317,6 @@ virBitmapShrink(virBitmapPtr map,
return -1;
map->map_len = nl;
map->map_alloc = nl;
return 0;
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册