// Copyright 2016 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file.
// Used by std::{push,pop}_heap functions inlinebooloperator<(const mozilla::UniquePtr<UserMessageEvent>& a, const mozilla::UniquePtr<UserMessageEvent>& b) { return a->sequence_num() > b->sequence_num();
}
MessageQueue::MessageQueue(uint64_t next_sequence_num)
: next_sequence_num_(next_sequence_num) { // The message queue is blocked waiting for a message with sequence number // equal to |next_sequence_num|.
}
// We keep the capacity of |heap_| in check so that a large batch of incoming // messages doesn't permanently wreck available memory. The choice of interval // here is somewhat arbitrary.
constexpr size_t kHeapMinimumShrinkSize = 16;
constexpr size_t kHeapShrinkInterval = 512; if (MOZ_UNLIKELY(heap_.size() > kHeapMinimumShrinkSize &&
heap_.size() % kHeapShrinkInterval == 0)) {
heap_.shrink_to_fit();
}
}
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.