// Expand the existing set to a bigger size void VectorSet::grow(uint new_word_capacity) {
assert(new_word_capacity < (1U << 30), "");
uint x = next_power_of_2(new_word_capacity); if (x > _data_size) {
_data = REALLOC_ARENA_ARRAY(_set_arena, uint32_t, _data, _size, x);
_data_size = x;
}
Copy::zero_to_bytes(_data + _size, (x - _size) * sizeof(uint32_t));
_size = x;
}
// Insert a member into an existing Set. void VectorSet::insert(uint elem) {
uint32_t word = elem >> word_bits;
uint32_t mask = 1U << (elem & bit_mask); if (word >= _size) {
grow(word);
}
_data[word] |= mask;
}
// Return true if the set is empty bool VectorSet::is_empty() const { for (uint32_t i = 0; i < _size; i++) { if (_data[i] != 0) { returnfalse;
}
} returntrue;
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.8 Sekunden
(vorverarbeitet am 2026-09-09)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.