[PATCH] Don't register jemalloc's zone allocator if something else already replaced the system default zone

Mike Hommey mh+jemalloc at glandium.org
Mon Oct 22 23:47:13 PDT 2012


On Tue, Oct 23, 2012 at 08:42:48AM +0200, Mike Hommey wrote:
> +	/*
> +	 * If something else replaced the system default zone allocator, don't
> +	 * register jemalloc's.
> +	 */
> +	malloc_zone_t *default_zone = malloc_default_zone();
> +	if (!default_zone->zone_name ||
> +	    strcmp(default_zone->zone_name, "DefaultMallocZone") != 0) {
> +		return;
> +	}

We're interested in hooking in between callers and jemalloc for Firefox
debug builds, which, on mac, means registering the hooks as a zone
allocator, but we can't allow jemalloc to hijack us (esp. when we're
trying to hijack it).

Mike



More information about the jemalloc-discuss mailing list