OS X/jemalloc: Fix deadlock on fork()
OS X/jemalloc: Fix deadlock on fork()

When running on OS X with jemalloc we install our own malloc zone
allocator (see darwin_zone.c) to allow us to track memory
allocations. However if an application using this calls fork(), then
there's a deadlock in preparing for the fork. The deadlock is caused
by attempting to lock the zone allocator twice - once via the actual
jemalloc zone, and a second time via our wrapper zone, as we naively
forward the lock/unlock calls down to the jemalloc allocator.

Fix this by making force_{lock,unlock} be a no-op in the wrapper zone,
and let the real jemalloc zone be locked directly.

Change-Id: I1ca580f39e19b0f74a38e230b20ff78bd1269928
Reviewed-on: http://review.couchbase.org/52968
Tested-by: buildbot <80754af91bfb6d1073585b046fe0a474ce868509@couchbase.com>
Reviewed-by: Trond Norbye <60edd2ef23891a753f231b0c6f161dc634079a93@gmail.com>

cloudrain21/memcached-1,couchbase/memcached,cloudrain21/memcached-1,daverigby/kv_engine,cloudrain21/memcached-1,daverigby/memcached,daverigby/kv_engine,owendCB/memcached,daverigby/memcached,couchbase/memcached,couchbase/memcached,daverigby/memcached,couchbase/memcached,daverigby/kv_engine,owendCB/memcached,owendCB/memcached,daverigby/kv_engine,cloudrain21/memcached-1,owendCB/memcached,daverigby/memcached