rbitset_copy(tgt->data, src->data, src->size);
}
+static inline void bitset_copy_into(bitset_t *tgt, const bitset_t *src)
+{
+ assert(tgt->size >= src->size);
+ rbitset_copy_into(tgt->data, src->data, src->size);
+}
+
/**
* Find the next unset bit from a given bit.
* @note Note that if pos is unset, pos is returned.
memcpy(dst, src, BITSET_SIZE_BYTES(size));
}
+static inline void rbitset_copy_into(unsigned *dst, const unsigned *src,
+ unsigned size)
+{
+ unsigned n = BITSET_SIZE_ELEMS(size);
+ unsigned last_mask = rbitset_last_mask_(size);
+
+ memcpy(dst, src, (n-1) * (BITS_PER_ELEM/8));
+ dst[n-1] = (src[n-1] & last_mask) | (dst[n-1] & ~last_mask);
+}
+
#endif
unsigned idx = get_irn_idx(irn);
if (idx >= bitset_size(lv->nodes)) {
bitset_t *nw = bitset_malloc(2 * idx);
- bitset_copy(nw, lv->nodes);
+ bitset_copy_into(nw, lv->nodes);
bitset_free(lv->nodes);
lv->nodes = nw;
}