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

Function add_map

ccan/ccan/ptr_valid/ptr_valid.c:60–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58}
59
60static struct ptr_valid_map *add_map(struct ptr_valid_map *map,
61 unsigned int *num,
62 unsigned int *max,
63 unsigned long start, unsigned long end, bool is_write)
64{
65 if (*num == *max) {
66 struct ptr_valid_map *newmap;
67 *max *= 2;
68 newmap = realloc(map, sizeof(*newmap) * *max);
69 if (!newmap) {
70 free(map);
71 return NULL;
72 }
73 map = newmap;
74 }
75 map[*num].start = (void *)start;
76 map[*num].end = (void *)end;
77 map[*num].is_write = is_write;
78 (*num)++;
79 return map;
80}
81
82static struct ptr_valid_map *get_proc_maps(unsigned int *num)
83{

Callers 1

get_proc_mapsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected