MCPcopy Create free account
hub / github.com/git/git / reftable_buf_add

Function reftable_buf_add

reftable/basics.c:122–136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120}
121
122int reftable_buf_add(struct reftable_buf *buf, const void *data, size_t len)
123{
124 size_t newlen = buf->len + len;
125
126 if (newlen + 1 > buf->alloc) {
127 if (REFTABLE_ALLOC_GROW(buf->buf, newlen + 1, buf->alloc))
128 return REFTABLE_OUT_OF_MEMORY_ERROR;
129 }
130
131 memcpy(buf->buf + buf->len, data, len);
132 buf->buf[newlen] = '\0';
133 buf->len = newlen;
134
135 return 0;
136}
137
138int reftable_buf_addstr(struct reftable_buf *buf, const char *s)
139{

Callers 15

writer_index_hashFunction · 0.85
writer_add_recordFunction · 0.85
reftable_writer_add_refFunction · 0.85
reftable_buf_addstrFunction · 0.85
stack_compact_rangeFunction · 0.85
decode_stringFunction · 0.85
reftable_decode_keyFunction · 0.85
reftable_obj_record_keyFunction · 0.85

Calls

no outgoing calls