darling-libobjc2/hash_table.c

23 lines
439 B
C
Raw Normal View History

#ifndef ENABLE_GC
#include "objc/toydispatch.h"
#include "lock.h"
#include "visibility.h"
2010-02-01 14:48:40 +00:00
static dispatch_queue_t garbage_queue;
PRIVATE void objc_collect_garbage_data(void(*cleanup)(void*), void *garbage)
2010-02-01 14:48:40 +00:00
{
if (0 == garbage_queue)
{
LOCK_RUNTIME_FOR_SCOPE();
if (0 == garbage_queue)
{
garbage_queue = dispatch_queue_create("ObjC deferred free queue", 0);
}
}
2010-02-01 14:48:40 +00:00
dispatch_async_f(garbage_queue, garbage, cleanup);
}
#endif