[PATCH] Make zone_{free, realloc, free_definite_size} fallback to the system allocator if they are called with a pointer that jemalloc didn't allocate

Mike Hommey mh+jemalloc at glandium.org
Mon Mar 26 23:43:57 PDT 2012

On Mon, Mar 26, 2012 at 01:00:10PM -0700, Jason Evans wrote:
> On Mar 26, 2012, at 9:39 AM, Mike Hommey wrote:
> > From: Mike Hommey <mh at glandium.org>
> > 
> > It turns out some OSX system libraries (like CoreGraphics on 10.6) like
> > to call malloc_zone_* functions, but giving them pointers that weren't
> > allocated with the zone they are using.
> > 
> > Possibly, they do malloc_zone_malloc(malloc_default_zone()) before we
> > register the jemalloc zone, and malloc_zone_realloc(malloc_default_zone())
> > after. malloc_default_zone() returning a different value in both cases.
> Applied; thanks.
> It's a shame that this is necessary…

There's more coming. I'm still getting crashes with Firefox on 10.6 (but
not 10.7). I found a workaround, but I need to find a way to make it
work on 10.5.


More information about the jemalloc-discuss mailing list