[PATCH 1/2] Move zone registration to zone.c

Mike Hommey mh+jemalloc at glandium.org
Fri Mar 30 11:03:52 PDT 2012


On Fri, Mar 30, 2012 at 10:54:36AM -0700, Jason Evans wrote:
> On Mar 27, 2012, at 5:46 AM, Mike Hommey wrote:
> > On Tue, Mar 27, 2012 at 02:20:12PM +0200, Mike Hommey wrote:
> >> @@ -743,8 +723,8 @@ void
> >> jemalloc_darwin_init(void)
> >> {
> >> 
> >> -	if (malloc_init_hard())
> >> -		abort();
> >> +	if (!malloc_init_hard())
> >> +		register_zone();
> >> }
> >> #endif
> > 
> > Please note that I first attempted to move this function too, and do
> > lazy initialization of jemalloc, but that ends up in a dead lock because
> > pthread_atfork calls malloc.
> 
> Now that pthread_atfork() isn't being called on Darwin, does deadlock
> still occur due to some other memory allocation during initialization?

I haven't experienced deadlocks during initialization, even when
pthread_atfork was called.

Mike



More information about the jemalloc-discuss mailing list