// If round will not go above fMaxCapacity return rounded capacity. if (capacity < fMaxCapacity - kCapacityMultiple) { return SkAlignTo(capacity, kCapacityMultiple);
}
return SkToSizeT(fMaxCapacity);
}
size_t SkContainerAllocator::growthFactorCapacity(int capacity, double growthFactor) const {
SkASSERT(capacity >= 0);
SkASSERT(growthFactor >= 1.0); // Multiply by the growthFactor. Remember this must be done in 64-bit ints and not // size_t because size_t changes. const int64_t capacityGrowth = static_cast<int64_t>(capacity * growthFactor);
// Notice that for small values of capacity, rounding up will provide most of the growth. return this->roundUpCapacity(capacityGrowth);
}
SkSpan<std::byte> sk_allocate_canfail(size_t size) { // Make sure to ask for at least the minimum number of bytes. const size_t adjustedSize = std::max(size, kMinBytes); void* ptr = sk_malloc_canfail(adjustedSize); return complete_size(ptr, adjustedSize);
}
SkSpan<std::byte> sk_allocate_throw(size_t size) { if (size == 0) { return {};
} // Make sure to ask for at least the minimum number of bytes. const size_t adjustedSize = std::max(size, kMinBytes); void* ptr = sk_malloc_throw(adjustedSize); return complete_size(ptr, adjustedSize);
}
void sk_report_container_overflow_and_die() {
SK_ABORT("Requested capacity is too large.");
}
Messung V0.5
¤ Dauer der Verarbeitung: 0.18 Sekunden
(vorverarbeitet)
¤
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.