Timestamp buffer: entry = (level_before_edge << 31) | cycle_count.
Returns the buffer; count receives the number of valid entries.