void InvocationCounter::set(uint count) {
uint carry = (_counter & carry_mask); // the carry bit is sticky
_counter = (count << number_of_noncount_bits) | carry;
}
void InvocationCounter::update(uint new_count) { // Don't make the method look like it's never been executed
uint counter = raw_counter();
uint c = extract_count(counter);
uint f = extract_carry(counter); // prevent from going to zero, to distinguish from never-executed methods if (c > 0 && new_count == 0) new_count = 1;
set(new_count, f);
}
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.