Lines Matching refs:alloc
16 sb->alloc = sb->len = 0; in strbuf_init()
25 if (sb->alloc) { in strbuf_release()
33 char *res = sb->alloc ? sb->buf : NULL; in strbuf_detach()
45 if (nr < sb->alloc) in strbuf_grow()
51 if (alloc_nr(sb->alloc) > nr) in strbuf_grow()
52 nr = alloc_nr(sb->alloc); in strbuf_grow()
58 buf = realloc(sb->alloc ? sb->buf : NULL, nr * sizeof(*buf)); in strbuf_grow()
63 sb->alloc = nr; in strbuf_grow()
100 len = vsnprintf(sb->buf + sb->len, sb->alloc - sb->len, fmt, ap); in strbuf_addv()
107 len = vsnprintf(sb->buf + sb->len, sb->alloc - sb->len, fmt, ap_saved); in strbuf_addv()
131 size_t oldalloc = sb->alloc; in strbuf_read()
141 cnt = read(fd, sb->buf + sb->len, sb->alloc - sb->len - 1); in strbuf_read()