On Tuesday 22 December 2009 06:06:28 am Mark Heily wrote:
When I define DISPATCH_DEBUG=1 and build the library under Linux, almost all of the test programs fail. I checked a couple of them, and they both fail a dispatch_assert() test at the same place: in _dispatch_ccache_init().
The reason is that the current implementation of malloc_zone for linux (src/shims/malloc_zone.h) is just a dummy implementation and returns always a null-pointer. Therefore, this assertion will always fail. The current dummy implementation just dispatches the zone_malloc calls to the normal malloc routine. The attached "patch" circumvents the problem with the assertion by allocating a zone and returning a pointer to it. The behavior of the zone_malloc remains the same. Martin