MCPcopy Create free account
hub / github.com/ElementsProject/lightning / tal_arr_remove_

Function tal_arr_remove_

common/utils.c:138–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

136}
137
138void tal_arr_remove_(void *p, size_t elemsize, size_t n)
139{
140 // p is a pointer-to-pointer for tal_resize.
141 char *objp = *(char **)p;
142 size_t len = tal_bytelen(objp);
143 assert(len % elemsize == 0);
144 assert((n + 1) * elemsize <= len);
145 memmove(objp + elemsize * n, objp + elemsize * (n+1),
146 len - (elemsize * (n+1)));
147 tal_resize((char **)p, len - elemsize);
148}
149
150static void tal_arr_append_bytes(void *p, const void *append, size_t bytes)
151{

Callers

nothing calls this directly

Calls 1

tal_bytelenFunction · 0.85

Tested by

no test coverage detected