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

Function next_free_node

common/gossmap.c:293–308  ·  view source on GitHub ↗

Freelist links through node_off of unused entries. */

Source from the content-addressed store, hash-verified

291
292/* Freelist links through node_off of unused entries. */
293static struct gossmap_node *next_free_node(struct gossmap *map)
294{
295 size_t f;
296
297 if (map->freed_nodes == UINT_MAX) {
298 /* Double in size, add second half to free list */
299 size_t n = tal_count(map->node_arr);
300 map->num_node_arr *= 2;
301 tal_resize(&map->node_arr, n * 2);
302 map->freed_nodes = init_node_arr(map->node_arr, n);
303 }
304
305 f = map->freed_nodes;
306 map->freed_nodes = map->node_arr[f].nann_off;
307 return &map->node_arr[f];
308}
309
310static u32 new_node(struct gossmap *map)
311{

Callers 1

new_nodeFunction · 0.85

Calls 1

init_node_arrFunction · 0.85

Tested by

no test coverage detected