Formatting fixes.
This commit is contained in:
parent
c096ccfe11
commit
5ff1839133
21
src/zone.c
21
src/zone.c
@ -168,7 +168,8 @@ zone_force_unlock(malloc_zone_t *zone)
|
||||
jemalloc_postfork_parent();
|
||||
}
|
||||
|
||||
static malloc_zone_t *get_default_zone()
|
||||
static malloc_zone_t *
|
||||
get_default_zone(void)
|
||||
{
|
||||
malloc_zone_t **zones = NULL;
|
||||
unsigned int num_zones = 0;
|
||||
@ -179,20 +180,22 @@ static malloc_zone_t *get_default_zone()
|
||||
* if one is present (apparently enabled when malloc stack logging is
|
||||
* enabled), or the first registered zone otherwise. In practice this
|
||||
* means unless malloc stack logging is enabled, the first registered
|
||||
* zone is the default.
|
||||
* So get the list of zones to get the first one, instead of relying on
|
||||
* malloc_default_zone.
|
||||
* zone is the default. So get the list of zones to get the first one,
|
||||
* instead of relying on malloc_default_zone.
|
||||
*/
|
||||
if (KERN_SUCCESS != malloc_get_all_zones(0, NULL, (vm_address_t**) &zones,
|
||||
&num_zones)) {
|
||||
/* Reset the value in case the failure happened after it was set. */
|
||||
if (KERN_SUCCESS != malloc_get_all_zones(0, NULL,
|
||||
(vm_address_t**)&zones, &num_zones)) {
|
||||
/*
|
||||
* Reset the value in case the failure happened after it was
|
||||
* set.
|
||||
*/
|
||||
num_zones = 0;
|
||||
}
|
||||
|
||||
if (num_zones)
|
||||
return zones[0];
|
||||
return (zones[0]);
|
||||
|
||||
return malloc_default_zone();
|
||||
return (malloc_default_zone());
|
||||
}
|
||||
|
||||
JEMALLOC_ATTR(constructor)
|
||||
|
Loading…
Reference in New Issue
Block a user