/* * Copyright (c) 2016, Alliance for Open Media. All rights reserved. * * This source code is subject to the terms of the BSD 2 Clause License and * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License * was not distributed with this source code in the LICENSE file, you can * obtain it at www.aomedia.org/license/software. If the Alliance for Open * Media Patent License 1.0 was not distributed with this source code in the * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
*/
void stats_write(stats_io_t *stats, constvoid *pkt, size_t len) { if (stats->file) {
(void)fwrite(pkt, 1, len, stats->file); return;
}
assert(stats->buf.sz <= stats->buf_alloc_sz);
assert(0 < stats->buf_alloc_sz); if (stats->buf.sz + len > stats->buf_alloc_sz) { // Grow by a factor of 1.5 each time, for amortized constant time. // Also make sure there is enough room for the data.
size_t new_sz = AOMMAX((3 * stats->buf_alloc_sz) / 2, stats->buf.sz + len); char *new_ptr = realloc(stats->buf.buf, new_sz);
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.