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