Lines Matching refs:sz
51 size_t sz = (len + 1 + BUFFER_PIECE_SIZE-1) & ~(BUFFER_PIECE_SIZE-1); in __attribute_nonnull__() local
52 force_assert(sz > len); in __attribute_nonnull__()
53 if ((sz & (sz-1)) && sz < INT_MAX) {/* not power-2; huge val not expected */ in __attribute_nonnull__()
55 const size_t psz = sz; in __attribute_nonnull__()
56 for (sz = 256; sz < psz; sz <<= 1) ; in __attribute_nonnull__()
58 sz |= 1; /*(extra +1 for '\0' when needed buffer size is exact power-2)*/ in __attribute_nonnull__()
60 b->size = sz; in __attribute_nonnull__()
61 b->ptr = realloc(b->ptr, sz); in __attribute_nonnull__()
148 size_t sz = b->used; in buffer_commit() local
149 if (0 == sz) sz = 1; in buffer_commit()
153 sz += size; in buffer_commit()
154 force_assert(sz > size); in buffer_commit()
157 b->used = sz; in buffer_commit()
158 b->ptr[sz - 1] = '\0'; in buffer_commit()