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

util: bitmap: Note that shrinking the bitmap requires clearing of unused bits

Note the fact that the unused portion of the last element in the bitmap
needs to be cleared, since we use functions which process only full-size
elements and don't really deal with individual bits.
上级 e88a08e8
...@@ -45,6 +45,10 @@ struct _virBitmap { ...@@ -45,6 +45,10 @@ struct _virBitmap {
size_t nbits; size_t nbits;
size_t map_len; size_t map_len;
size_t map_alloc; size_t map_alloc;
/* Note that code below depends on the fact that unused bits of the bitmap
* are not set. Any function decreasing the size of the map needs clear
* bits which don't belong to the bitmap any more. */
unsigned long *map; unsigned long *map;
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册