We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eea522b commit bd3914eCopy full SHA for bd3914e
1 file changed
h_malloc.c
@@ -1074,8 +1074,13 @@ static int regions_grow(void) {
1074
}
1075
1076
1077
- memory_map_fixed(ra->regions, ra->total * sizeof(struct region_metadata));
1078
- memory_set_name(ra->regions, ra->total * sizeof(struct region_metadata), "malloc allocator_state");
+ if (memory_map_fixed(ra->regions, ra->total * sizeof(struct region_metadata))) {
+ if (memory_purge(ra->regions, ra->total * sizeof(struct region_metadata))) {
1079
+ memset(ra->regions, 0, ra->total * sizeof(struct region_metadata));
1080
+ }
1081
+ } else {
1082
+ memory_set_name(ra->regions, ra->total * sizeof(struct region_metadata), "malloc allocator_state");
1083
1084
ra->free = ra->free + ra->total;
1085
ra->total = newtotal;
1086
ra->regions = p;
0 commit comments