Lines Matching refs:alloc
41 void vstr_init(vstr_t *vstr, size_t alloc) { in vstr_init() argument
42 if (alloc < 1) { in vstr_init()
43 alloc = 1; in vstr_init()
45 vstr->alloc = alloc; in vstr_init()
47 vstr->buf = m_new(char, vstr->alloc); in vstr_init()
58 void vstr_init_fixed_buf(vstr_t *vstr, size_t alloc, char *buf) { in vstr_init_fixed_buf() argument
59 vstr->alloc = alloc; in vstr_init_fixed_buf()
65 void vstr_init_print(vstr_t *vstr, size_t alloc, mp_print_t *print) { in vstr_init_print() argument
66 vstr_init(vstr, alloc); in vstr_init_print()
73 m_del(char, vstr->buf, vstr->alloc); in vstr_clear()
78 vstr_t *vstr_new(size_t alloc) { in vstr_new() argument
80 vstr_init(vstr, alloc); in vstr_new()
87 m_del(char, vstr->buf, vstr->alloc); in vstr_free()
100 char *new_buf = m_renew(char, vstr->buf, vstr->alloc, vstr->alloc + size); in vstr_extend()
101 char *p = new_buf + vstr->alloc; in vstr_extend()
102 vstr->alloc += size; in vstr_extend()
108 if (vstr->len + size > vstr->alloc) { in vstr_ensure_extra()
115 char *new_buf = m_renew(char, vstr->buf, vstr->alloc, new_alloc); in vstr_ensure_extra()
116 vstr->alloc = new_alloc; in vstr_ensure_extra()
135 if (vstr->alloc == vstr->len) { in vstr_null_terminated_str()