MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / strbuf_new

Function strbuf_new

util/strbuf.c:39–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37};
38
39strbuf *strbuf_new(void)
40{
41 strbuf *buf = malloc(sizeof(strbuf));
42 if (buf == 0) {
43 logmsg(LOGMSG_FATAL, "%s: memory allocation failed\n", __func__);
44 abort();
45 }
46 buf->buf = malloc(STRBUF_INC);
47 if (buf->buf == 0) {
48 logmsg(LOGMSG_FATAL, "%s: memory allocation failed\n", __func__);
49 abort();
50 }
51 buf->buf[0] = '\0';
52 buf->alloc = STRBUF_INC;
53 buf->len = 0;
54 return buf;
55}
56
57void strbuf_append(strbuf *buf, const char *str)
58{

Callers 15

stackutil_get_stack_strFunction · 0.70
get_stack_backtraceFunction · 0.50
comdb2CreateTriggerFunction · 0.50
format_csc2Function · 0.50
retrieve_schemaFunction · 0.50
comdb2AddIndexIntFunction · 0.50
reset_json_cursorsFunction · 0.50
systbl_connectFunction · 0.50
fdb_svc_alter_schemaFunction · 0.50
get_query_cost_as_stringFunction · 0.50
newsql_dump_query_planFunction · 0.50
form_query_planFunction · 0.50

Calls 2

mallocFunction · 0.85
logmsgFunction · 0.70

Tested by

no test coverage detected