Lines Matching refs:size

105     size_t size;
220 // Capacity must be > size because we insert a NUL byte.
223 unsigned size;
291 int limit; // 80% of table size ((mask+1)*8/10)
406 static struct zlist *zlist_initx(struct zlist *p, size_t size, size_t count)
408 p->base = p->avail = xzalloc(count * size);
409 p->limit = p->base + size * count;
410 p->size = size;
414 static struct zlist *zlist_init(struct zlist *p, size_t size)
417 return zlist_initx(p, size, SLIST_MAX_INIT_BYTES / size);
425 size_t newcap = maxof(cap + p->size, ((cap / p->size) * 3 / 2) * p->size);
435 // Insert obj (p->size bytes) at end of list, expand as needed.
439 if (p->avail > p->limit - p->size) {
440 objtemp = xmalloc(p->size); // Copy obj in case it is in
441 memmove(objtemp, obj, p->size); // the area realloc might free!
445 memmove(p->avail, obj, p->size);
447 p->avail += p->size;
448 return (p->avail - p->base - p->size) / p->size; // offset of updated slot
453 return (p->avail - p->base) / p->size;
481 to->size = at + n;
482 to->str[to->size] = '\0';
493 to = zstring_modify(0, 0, to->str, to->size);
501 return zstring_update(to, 0, from->str, from->size);
506 return zstring_update(to, to->size, from->str, from->size);
509 static struct zstring *new_zstring(char *s, size_t size)
511 return zstring_modify(0, 0, s, size);
561 struct zstring *z = new_zstring(v->vst->str, v->vst->size);
572 return a->size == b->size && memcmp(a->str, b->str, a->size) == 0;
578 char *p = s->str, *lim = p + s->size;
660 // New table is twice the size of old.
661 int size = m->mask + 1;
662 unsigned mask = 2 * size - 1;
663 int *h = xzalloc(2 * size * sizeof(*m->hash));
665 for (int i = 0; i < size; i++) {
680 m->limit = 2 * size * 8 / 10;
1250 // Init stack size at twice MIN_STACK_LEFT. MIN_STACK_LEFT is at least as
2715 static void set_zvalue_str(struct zvalue *v, char *s, size_t size)
2717 v->vst = zstring_update(v->vst, 0, s, size);
2728 static void set_field(struct zmap *unused, int fnum, char *s, size_t size)
2735 set_zvalue_str(&FIELD[fnum], s, size);
3095 int len = vsnprintf(0, 0, fmt, args); // size needed
3099 if (TT.rgl.zspr->size + len + 1 > TT.rgl.zspr->capacity) {
3100 // This should always work b/c capacity > size
3105 vsnprintf(TT.rgl.zspr->str + TT.rgl.zspr->size, len+1, fmt, args2);
3106 TT.rgl.zspr->size += len;
3107 TT.rgl.zspr->str[TT.rgl.zspr->size] = 0;
3160 n = utf8towc(&wch, z->vst->str, z->vst->size) < 1 ? 0xfffd : wch;
3470 #define SLEN(zvalp) ((zvalp)->vst->size)
3478 // A pass just to determine needed destination (result) string size.
3532 z->size = e - z->str;
4171 int nchars = utf8cnt(zz->str, zz->size); // number of utf8 codepoints
4176 mm = bytesinutf8(zz->str, zz->size, mm);
4177 nn = bytesinutf8(zz->str + mm, zz->size - mm, nn);
4216 unsigned zzlen = z->size + 4; // Allow for expansion
4218 char *p = z->str, *e = z->str + z->size, *q = zz->str;
4237 zz->size = q - zz->str;
4249 k = utf8cnt(v->vst->str, v->vst->size);