Skip to content
This repository has been archived by the owner on Feb 5, 2019. It is now read-only.

Commit

Permalink
Formatting fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
jasone authored and glandium committed Jan 18, 2017
1 parent da18fef commit 515d2a0
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions src/zone.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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)
Expand Down

0 comments on commit 515d2a0

Please sign in to comment.