}
}
-STATIC word GC_register_map_entries(char *maps)
+STATIC void GC_register_map_entries(char *maps)
{
char *prot;
char *buf_ptr = maps;
for (;;) {
buf_ptr = GC_parse_map_entry(buf_ptr, &start, &end, &prot,
&maj_dev, 0);
- if (buf_ptr == NULL) return 1;
+ if (NULL == buf_ptr)
+ break;
if (prot[1] == 'w') {
/* This is a writable mapping. Add it to */
/* the root set unless it is already otherwise */
GC_add_roots_inner((char *)start, (char *)end, TRUE);
}
}
- return 1;
}
GC_INNER void GC_register_dynamic_libraries(void)
{
- if (!GC_register_map_entries(GC_get_maps()))
+ char *maps = GC_get_maps();
+
+ if (NULL == maps)
ABORT("Failed to read /proc for library registration");
+ GC_register_map_entries(maps);
}
/* We now take care of the main data segment ourselves: */
} while (maps_size >= maps_buf_sz || maps_size < old_maps_size);
/* In the single-threaded case, the second clause is false. */
maps_buf[maps_size] = '\0';
-
- /* Apply fn to result. */
return maps_buf;
}