1 /* Variable array bitsets.
2 Copyright (C) 2002, 2003 Free Software Foundation, Inc.
3 Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
28 /* This file implements variable size bitsets stored as a variable
29 length array of words. Any unused bits in the last word must be
32 Note that binary or ternary operations assume that each bitset operand
36 static void vbitset_unused_clear
PARAMS ((bitset
));
38 static void vbitset_set
PARAMS ((bitset
, bitset_bindex
));
39 static void vbitset_reset
PARAMS ((bitset
, bitset_bindex
));
40 static bool vbitset_test
PARAMS ((bitset
, bitset_bindex
));
41 static bitset_bindex vbitset_list
PARAMS ((bitset
, bitset_bindex
*,
44 static bitset_bindex vbitset_list_reverse
PARAMS ((bitset
, bitset_bindex
*,
48 #define VBITSET_N_WORDS(N) (((N) + BITSET_WORD_BITS - 1) / BITSET_WORD_BITS)
49 #define VBITSET_WORDS(X) ((X)->b.cdata)
50 #define VBITSET_SIZE(X) ((X)->b.csize)
51 #define VBITSET_ASIZE(X) ((X)->v.size)
54 #define min(a, b) ((a) > (b) ? (b) : (a))
55 #define max(a, b) ((a) > (b) ? (a) : (b))
58 vbitset_resize (src
, n_bits
)
62 bitset_windex oldsize
;
63 bitset_windex newsize
;
65 if (n_bits
== BITSET_NBITS_ (src
))
68 oldsize
= VBITSET_SIZE (src
);
69 newsize
= VBITSET_N_WORDS (n_bits
);
71 if (oldsize
< newsize
)
75 /* The bitset needs to grow. If we already have enough memory
76 allocated, then just zero what we need. */
77 if (newsize
> VBITSET_ASIZE (src
))
79 /* We need to allocate more memory. When oldsize is
80 non-zero this means that we are changing the size, so
81 grow the bitset 25% larger than requested to reduce
82 number of reallocations. */
87 size
= newsize
+ newsize
/ 4;
90 = realloc (VBITSET_WORDS (src
), size
* sizeof (bitset_word
));
91 VBITSET_ASIZE (src
) = size
;
94 memset (VBITSET_WORDS (src
) + oldsize
, 0,
95 (newsize
- oldsize
) * sizeof (bitset_word
));
96 VBITSET_SIZE (src
) = newsize
;
100 /* The bitset needs to shrink. There's no point deallocating
101 the memory unless it is shrinking by a reasonable amount. */
102 if ((oldsize
- newsize
) >= oldsize
/ 2)
105 = realloc (VBITSET_WORDS (src
), newsize
* sizeof (bitset_word
));
106 VBITSET_ASIZE (src
) = newsize
;
109 /* Need to prune any excess bits. FIXME. */
111 VBITSET_SIZE (src
) = newsize
;
114 BITSET_NBITS_ (src
) = n_bits
;
119 /* Set bit BITNO in bitset DST. */
121 vbitset_set (dst
, bitno
)
125 bitset_windex windex
= bitno
/ BITSET_WORD_BITS
;
127 /* Perhaps we should abort. The user should explicitly call
128 bitset_resize since this will not catch the case when we set a
129 bit larger than the current size but smaller than the allocated
131 vbitset_resize (dst
, bitno
);
133 dst
->b
.cdata
[windex
- dst
->b
.cindex
] |=
134 (bitset_word
) 1 << (bitno
% BITSET_WORD_BITS
);
138 /* Reset bit BITNO in bitset DST. */
140 vbitset_reset (dst
, bitno
)
141 bitset dst ATTRIBUTE_UNUSED
;
142 bitset_bindex bitno ATTRIBUTE_UNUSED
;
144 /* We must be accessing outside the cache so the bit is
149 /* Test bit BITNO in bitset SRC. */
151 vbitset_test (src
, bitno
)
152 bitset src ATTRIBUTE_UNUSED
;
153 bitset_bindex bitno ATTRIBUTE_UNUSED
;
155 /* We must be accessing outside the cache so the bit is
161 /* Find list of up to NUM bits set in BSET in reverse order, starting
162 from and including NEXT and store in array LIST. Return with
163 actual number of bits found and with *NEXT indicating where search
166 vbitset_list_reverse (src
, list
, num
, next
)
173 bitset_bindex rbitno
;
175 bitset_windex windex
;
177 bitset_bindex bitoff
;
178 bitset_word
*srcp
= VBITSET_WORDS (src
);
179 bitset_bindex n_bits
= BITSET_SIZE_ (src
);
183 /* If num is 1, we could speed things up with a binary search
184 of the word of interest. */
186 if (rbitno
>= n_bits
)
191 bitno
= n_bits
- (rbitno
+ 1);
193 windex
= bitno
/ BITSET_WORD_BITS
;
194 bitcnt
= bitno
% BITSET_WORD_BITS
;
195 bitoff
= windex
* BITSET_WORD_BITS
;
201 word
= srcp
[windex
] << (BITSET_WORD_BITS
- 1 - bitcnt
);
202 for (; word
; bitcnt
--)
204 if (word
& BITSET_MSB
)
206 list
[count
++] = bitoff
+ bitcnt
;
209 *next
= n_bits
- (bitoff
+ bitcnt
);
215 bitoff
-= BITSET_WORD_BITS
;
216 bitcnt
= BITSET_WORD_BITS
- 1;
220 *next
= n_bits
- (bitoff
+ 1);
225 /* Find list of up to NUM bits set in BSET starting from and including
226 *NEXT and store in array LIST. Return with actual number of bits
227 found and with *NEXT indicating where search stopped. */
229 vbitset_list (src
, list
, num
, next
)
237 bitset_windex windex
;
238 bitset_bindex bitoff
;
239 bitset_windex size
= VBITSET_SIZE (src
);
240 bitset_word
*srcp
= VBITSET_WORDS (src
);
248 /* Many bitsets are zero, so make this common case fast. */
249 for (windex
= 0; windex
< size
&& !srcp
[windex
]; windex
++)
254 /* If num is 1, we could speed things up with a binary search
255 of the current word. */
257 bitoff
= windex
* BITSET_WORD_BITS
;
261 if (bitno
>= BITSET_SIZE_ (src
))
264 windex
= bitno
/ BITSET_WORD_BITS
;
265 bitno
= bitno
% BITSET_WORD_BITS
;
269 /* Handle the case where we start within a word.
270 Most often, this is executed with large bitsets
271 with many set bits where we filled the array
272 on the previous call to this function. */
274 bitoff
= windex
* BITSET_WORD_BITS
;
275 word
= srcp
[windex
] >> bitno
;
276 for (bitno
= bitoff
+ bitno
; word
; bitno
++)
280 list
[count
++] = bitno
;
291 bitoff
= windex
* BITSET_WORD_BITS
;
294 for (; windex
< size
; windex
++, bitoff
+= BITSET_WORD_BITS
)
296 if (!(word
= srcp
[windex
]))
299 if ((count
+ BITSET_WORD_BITS
) < num
)
301 for (bitno
= bitoff
; word
; bitno
++)
304 list
[count
++] = bitno
;
310 for (bitno
= bitoff
; word
; bitno
++)
314 list
[count
++] = bitno
;
331 /* Ensure that any unused bits within the last word are clear. */
333 vbitset_unused_clear (dst
)
336 unsigned int last_bit
;
338 last_bit
= BITSET_SIZE_ (dst
) % BITSET_WORD_BITS
;
340 VBITSET_WORDS (dst
)[VBITSET_SIZE (dst
) - 1] &=
341 ((bitset_word
) 1 << last_bit
) - 1;
349 bitset_word
*dstp
= VBITSET_WORDS (dst
);
352 bytes
= sizeof (bitset_word
) * VBITSET_SIZE (dst
);
354 memset (dstp
, -1, bytes
);
355 vbitset_unused_clear (dst
);
363 bitset_word
*dstp
= VBITSET_WORDS (dst
);
366 bytes
= sizeof (bitset_word
) * VBITSET_SIZE (dst
);
368 memset (dstp
, 0, bytes
);
373 vbitset_empty_p (dst
)
377 bitset_word
*dstp
= VBITSET_WORDS (dst
);
379 for (i
= 0; i
< VBITSET_SIZE (dst
); i
++)
388 vbitset_copy1 (dst
, src
)
400 vbitset_resize (dst
, BITSET_SIZE_ (src
));
402 srcp
= VBITSET_WORDS (src
);
403 dstp
= VBITSET_WORDS (dst
);
404 ssize
= VBITSET_SIZE (src
);
405 dsize
= VBITSET_SIZE (dst
);
407 memcpy (dstp
, srcp
, sizeof (bitset_word
) * ssize
);
409 memset (dstp
+ sizeof (bitset_word
) * ssize
, 0,
410 sizeof (bitset_word
) * (dsize
- ssize
));
415 vbitset_not (dst
, src
)
425 vbitset_resize (dst
, BITSET_SIZE_ (src
));
427 srcp
= VBITSET_WORDS (src
);
428 dstp
= VBITSET_WORDS (dst
);
429 ssize
= VBITSET_SIZE (src
);
430 dsize
= VBITSET_SIZE (dst
);
432 for (i
= 0; i
< ssize
; i
++)
433 *dstp
++ = ~(*srcp
++);
435 vbitset_unused_clear (dst
);
436 memset (dstp
+ sizeof (bitset_word
) * ssize
, 0,
437 sizeof (bitset_word
) * (dsize
- ssize
));
442 vbitset_equal_p (dst
, src
)
447 bitset_word
*srcp
= VBITSET_WORDS (src
);
448 bitset_word
*dstp
= VBITSET_WORDS (dst
);
449 bitset_windex ssize
= VBITSET_SIZE (src
);
450 bitset_windex dsize
= VBITSET_SIZE (dst
);
452 for (i
= 0; i
< min (ssize
, dsize
); i
++)
453 if (*srcp
++ != *dstp
++)
458 for (; i
< ssize
; i
++)
464 for (; i
< dsize
; i
++)
474 vbitset_subset_p (dst
, src
)
479 bitset_word
*srcp
= VBITSET_WORDS (src
);
480 bitset_word
*dstp
= VBITSET_WORDS (dst
);
481 bitset_windex ssize
= VBITSET_SIZE (src
);
482 bitset_windex dsize
= VBITSET_SIZE (dst
);
484 for (i
= 0; i
< min (ssize
, dsize
); i
++, dstp
++, srcp
++)
485 if (*dstp
!= (*srcp
| *dstp
))
490 for (; i
< ssize
; i
++)
500 vbitset_disjoint_p (dst
, src
)
505 bitset_word
*srcp
= VBITSET_WORDS (src
);
506 bitset_word
*dstp
= VBITSET_WORDS (dst
);
507 bitset_windex ssize
= VBITSET_SIZE (src
);
508 bitset_windex dsize
= VBITSET_SIZE (dst
);
510 for (i
= 0; i
< min (ssize
, dsize
); i
++)
511 if (*srcp
++ & *dstp
++)
519 vbitset_and (dst
, src1
, src2
)
528 bitset_windex ssize1
;
529 bitset_windex ssize2
;
532 vbitset_resize (dst
, max (BITSET_SIZE_ (src1
), BITSET_SIZE_ (src2
)));
534 dsize
= VBITSET_SIZE (dst
);
535 ssize1
= VBITSET_SIZE (src1
);
536 ssize2
= VBITSET_SIZE (src2
);
537 dstp
= VBITSET_WORDS (dst
);
538 src1p
= VBITSET_WORDS (src1
);
539 src2p
= VBITSET_WORDS (src2
);
541 for (i
= 0; i
< min (ssize1
, ssize2
); i
++)
542 *dstp
++ = *src1p
++ & *src2p
++;
544 memset (dstp
, 0, sizeof (bitset_word
) * (dsize
- min (ssize1
, ssize2
)));
549 vbitset_and_cmp (dst
, src1
, src2
)
559 bitset_windex ssize1
;
560 bitset_windex ssize2
;
563 vbitset_resize (dst
, max (BITSET_SIZE_ (src1
), BITSET_SIZE_ (src2
)));
565 dsize
= VBITSET_SIZE (dst
);
566 ssize1
= VBITSET_SIZE (src1
);
567 ssize2
= VBITSET_SIZE (src2
);
568 dstp
= VBITSET_WORDS (dst
);
569 src1p
= VBITSET_WORDS (src1
);
570 src2p
= VBITSET_WORDS (src2
);
572 for (i
= 0; i
< min (ssize1
, ssize2
); i
++, dstp
++)
574 bitset_word tmp
= *src1p
++ & *src2p
++;
589 for (; i
< ssize1
; i
++, dstp
++)
598 memset (dstp
, 0, sizeof (bitset_word
) * (dsize
- ssize1
));
605 vbitset_andn (dst
, src1
, src2
)
614 bitset_windex ssize1
;
615 bitset_windex ssize2
;
618 vbitset_resize (dst
, max (BITSET_SIZE_ (src1
), BITSET_SIZE_ (src2
)));
620 dsize
= VBITSET_SIZE (dst
);
621 ssize1
= VBITSET_SIZE (src1
);
622 ssize2
= VBITSET_SIZE (src2
);
623 dstp
= VBITSET_WORDS (dst
);
624 src1p
= VBITSET_WORDS (src1
);
625 src2p
= VBITSET_WORDS (src2
);
627 for (i
= 0; i
< min (ssize1
, ssize2
); i
++)
628 *dstp
++ = *src1p
++ & ~(*src2p
++);
632 for (; i
< ssize2
; i
++)
635 memset (dstp
, 0, sizeof (bitset_word
) * (dsize
- ssize2
));
639 for (; i
< ssize1
; i
++)
642 memset (dstp
, 0, sizeof (bitset_word
) * (dsize
- ssize1
));
648 vbitset_andn_cmp (dst
, src1
, src2
)
658 bitset_windex ssize1
;
659 bitset_windex ssize2
;
662 vbitset_resize (dst
, max (BITSET_SIZE_ (src1
), BITSET_SIZE_ (src2
)));
664 dsize
= VBITSET_SIZE (dst
);
665 ssize1
= VBITSET_SIZE (src1
);
666 ssize2
= VBITSET_SIZE (src2
);
667 dstp
= VBITSET_WORDS (dst
);
668 src1p
= VBITSET_WORDS (src1
);
669 src2p
= VBITSET_WORDS (src2
);
671 for (i
= 0; i
< min (ssize1
, ssize2
); i
++, dstp
++)
673 bitset_word tmp
= *src1p
++ & ~(*src2p
++);
684 for (; i
< ssize2
; i
++, dstp
++)
693 memset (dstp
, 0, sizeof (bitset_word
) * (dsize
- ssize2
));
697 for (; i
< ssize1
; i
++, dstp
++)
699 bitset_word tmp
= *src1p
++;
708 memset (dstp
, 0, sizeof (bitset_word
) * (dsize
- ssize1
));
716 vbitset_or (dst
, src1
, src2
)
725 bitset_windex ssize1
;
726 bitset_windex ssize2
;
729 vbitset_resize (dst
, max (BITSET_SIZE_ (src1
), BITSET_SIZE_ (src2
)));
731 dsize
= VBITSET_SIZE (dst
);
732 ssize1
= VBITSET_SIZE (src1
);
733 ssize2
= VBITSET_SIZE (src2
);
734 dstp
= VBITSET_WORDS (dst
);
735 src1p
= VBITSET_WORDS (src1
);
736 src2p
= VBITSET_WORDS (src2
);
738 for (i
= 0; i
< min (ssize1
, ssize2
); i
++)
739 *dstp
++ = *src1p
++ | *src2p
++;
747 for (; i
< ssize1
; i
++)
750 memset (dstp
, 0, sizeof (bitset_word
) * (dsize
- ssize1
));
755 vbitset_or_cmp (dst
, src1
, src2
)
765 bitset_windex ssize1
;
766 bitset_windex ssize2
;
769 vbitset_resize (dst
, max (BITSET_SIZE_ (src1
), BITSET_SIZE_ (src2
)));
771 dsize
= VBITSET_SIZE (dst
);
772 ssize1
= VBITSET_SIZE (src1
);
773 ssize2
= VBITSET_SIZE (src2
);
774 dstp
= VBITSET_WORDS (dst
);
775 src1p
= VBITSET_WORDS (src1
);
776 src2p
= VBITSET_WORDS (src2
);
778 for (i
= 0; i
< min (ssize1
, ssize2
); i
++, dstp
++)
780 bitset_word tmp
= *src1p
++ | *src2p
++;
795 for (; i
< ssize1
; i
++, dstp
++)
797 bitset_word tmp
= *src1p
++;
806 memset (dstp
, 0, sizeof (bitset_word
) * (dsize
- ssize1
));
813 vbitset_xor (dst
, src1
, src2
)
822 bitset_windex ssize1
;
823 bitset_windex ssize2
;
826 vbitset_resize (dst
, max (BITSET_SIZE_ (src1
), BITSET_SIZE_ (src2
)));
828 dsize
= VBITSET_SIZE (dst
);
829 ssize1
= VBITSET_SIZE (src1
);
830 ssize2
= VBITSET_SIZE (src2
);
831 dstp
= VBITSET_WORDS (dst
);
832 src1p
= VBITSET_WORDS (src1
);
833 src2p
= VBITSET_WORDS (src2
);
835 for (i
= 0; i
< min (ssize1
, ssize2
); i
++)
836 *dstp
++ = *src1p
++ ^ *src2p
++;
844 for (; i
< ssize1
; i
++)
847 memset (dstp
, 0, sizeof (bitset_word
) * (dsize
- ssize1
));
852 vbitset_xor_cmp (dst
, src1
, src2
)
862 bitset_windex ssize1
;
863 bitset_windex ssize2
;
866 vbitset_resize (dst
, max (BITSET_SIZE_ (src1
), BITSET_SIZE_ (src2
)));
868 dsize
= VBITSET_SIZE (dst
);
869 ssize1
= VBITSET_SIZE (src1
);
870 ssize2
= VBITSET_SIZE (src2
);
871 dstp
= VBITSET_WORDS (dst
);
872 src1p
= VBITSET_WORDS (src1
);
873 src2p
= VBITSET_WORDS (src2
);
875 for (i
= 0; i
< min (ssize1
, ssize2
); i
++, dstp
++)
877 bitset_word tmp
= *src1p
++ ^ *src2p
++;
892 for (; i
< ssize1
; i
++, dstp
++)
894 bitset_word tmp
= *src1p
++;
903 memset (dstp
, 0, sizeof (bitset_word
) * (dsize
- ssize1
));
909 /* FIXME, these operations need fixing for different size
913 vbitset_and_or (dst
, src1
, src2
, src3
)
926 if (BITSET_NBITS_ (src1
) != BITSET_NBITS_ (src2
)
927 || BITSET_NBITS_ (src1
) != BITSET_NBITS_ (src3
))
929 bitset_and_or_ (dst
, src1
, src2
, src3
);
933 vbitset_resize (dst
, BITSET_NBITS_ (src1
));
935 src1p
= VBITSET_WORDS (src1
);
936 src2p
= VBITSET_WORDS (src2
);
937 src3p
= VBITSET_WORDS (src3
);
938 dstp
= VBITSET_WORDS (dst
);
939 size
= VBITSET_SIZE (dst
);
941 for (i
= 0; i
< size
; i
++)
942 *dstp
++ = (*src1p
++ & *src2p
++) | *src3p
++;
947 vbitset_and_or_cmp (dst
, src1
, src2
, src3
)
961 if (BITSET_NBITS_ (src1
) != BITSET_NBITS_ (src2
)
962 || BITSET_NBITS_ (src1
) != BITSET_NBITS_ (src3
))
963 return bitset_and_or_cmp_ (dst
, src1
, src2
, src3
);
965 vbitset_resize (dst
, BITSET_NBITS_ (src1
));
967 src1p
= VBITSET_WORDS (src1
);
968 src2p
= VBITSET_WORDS (src2
);
969 src3p
= VBITSET_WORDS (src3
);
970 dstp
= VBITSET_WORDS (dst
);
971 size
= VBITSET_SIZE (dst
);
973 for (i
= 0; i
< size
; i
++, dstp
++)
975 bitset_word tmp
= (*src1p
++ & *src2p
++) | *src3p
++;
988 vbitset_andn_or (dst
, src1
, src2
, src3
)
1001 if (BITSET_NBITS_ (src1
) != BITSET_NBITS_ (src2
)
1002 || BITSET_NBITS_ (src1
) != BITSET_NBITS_ (src3
))
1004 bitset_andn_or_ (dst
, src1
, src2
, src3
);
1008 vbitset_resize (dst
, BITSET_NBITS_ (src1
));
1010 src1p
= VBITSET_WORDS (src1
);
1011 src2p
= VBITSET_WORDS (src2
);
1012 src3p
= VBITSET_WORDS (src3
);
1013 dstp
= VBITSET_WORDS (dst
);
1014 size
= VBITSET_SIZE (dst
);
1016 for (i
= 0; i
< size
; i
++)
1017 *dstp
++ = (*src1p
++ & ~(*src2p
++)) | *src3p
++;
1022 vbitset_andn_or_cmp (dst
, src1
, src2
, src3
)
1036 if (BITSET_NBITS_ (src1
) != BITSET_NBITS_ (src2
)
1037 || BITSET_NBITS_ (src1
) != BITSET_NBITS_ (src3
))
1038 return bitset_andn_or_cmp_ (dst
, src1
, src2
, src3
);
1040 vbitset_resize (dst
, BITSET_NBITS_ (src1
));
1042 src1p
= VBITSET_WORDS (src1
);
1043 src2p
= VBITSET_WORDS (src2
);
1044 src3p
= VBITSET_WORDS (src3
);
1045 dstp
= VBITSET_WORDS (dst
);
1046 size
= VBITSET_SIZE (dst
);
1048 for (i
= 0; i
< size
; i
++, dstp
++)
1050 bitset_word tmp
= (*src1p
++ & ~(*src2p
++)) | *src3p
++;
1063 vbitset_or_and (dst
, src1
, src2
, src3
)
1076 if (BITSET_NBITS_ (src1
) != BITSET_NBITS_ (src2
)
1077 || BITSET_NBITS_ (src1
) != BITSET_NBITS_ (src3
))
1079 bitset_or_and_ (dst
, src1
, src2
, src3
);
1083 vbitset_resize (dst
, BITSET_NBITS_ (src1
));
1085 src1p
= VBITSET_WORDS (src1
);
1086 src2p
= VBITSET_WORDS (src2
);
1087 src3p
= VBITSET_WORDS (src3
);
1088 dstp
= VBITSET_WORDS (dst
);
1089 size
= VBITSET_SIZE (dst
);
1091 for (i
= 0; i
< size
; i
++)
1092 *dstp
++ = (*src1p
++ | *src2p
++) & *src3p
++;
1097 vbitset_or_and_cmp (dst
, src1
, src2
, src3
)
1111 if (BITSET_NBITS_ (src1
) != BITSET_NBITS_ (src2
)
1112 || BITSET_NBITS_ (src1
) != BITSET_NBITS_ (src3
))
1113 return bitset_or_and_cmp_ (dst
, src1
, src2
, src3
);
1115 vbitset_resize (dst
, BITSET_NBITS_ (src1
));
1117 src1p
= VBITSET_WORDS (src1
);
1118 src2p
= VBITSET_WORDS (src2
);
1119 src3p
= VBITSET_WORDS (src3
);
1120 dstp
= VBITSET_WORDS (dst
);
1121 size
= VBITSET_SIZE (dst
);
1123 for (i
= 0; i
< size
; i
++, dstp
++)
1125 bitset_word tmp
= (*src1p
++ | *src2p
++) & *src3p
++;
1138 vbitset_copy (dst
, src
)
1142 if (BITSET_COMPATIBLE_ (dst
, src
))
1143 vbitset_copy1 (dst
, src
);
1145 bitset_copy_ (dst
, src
);
1149 /* Vector of operations for multiple word bitsets. */
1150 struct bitset_vtable vbitset_vtable
= {
1177 vbitset_andn_or_cmp
,
1181 vbitset_list_reverse
,
1188 vbitset_bytes (n_bits
)
1189 bitset_bindex n_bits ATTRIBUTE_UNUSED
;
1191 return sizeof (struct vbitset_struct
);
1196 vbitset_init (bset
, n_bits
)
1198 bitset_bindex n_bits
;
1200 bset
->b
.vtable
= &vbitset_vtable
;
1204 VBITSET_SIZE (bset
) = 0;
1205 vbitset_resize (bset
, n_bits
);