-static struct gc_string *gc_string_alloc(struct ctf_scanner *scanner,
- size_t len)
-{
- struct gc_string *gstr;
- size_t alloclen;
-
- /* TODO: could be faster with find first bit or glib Gstring */
- /* sizeof long to account for malloc header (int or long ?) */
- for (alloclen = 8; alloclen < sizeof(long) + sizeof(*gstr) + len;
- alloclen *= 2);
-
- gstr = malloc(alloclen);
- bt_list_add(&gstr->gc, &scanner->allocated_strings);
- gstr->alloclen = alloclen;
- return gstr;
-}
-