You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
439 B
C
23 lines
439 B
C
#ifndef ENABLE_GC
|
|
#include "objc/toydispatch.h"
|
|
#include "lock.h"
|
|
#include "visibility.h"
|
|
|
|
|
|
static dispatch_queue_t garbage_queue;
|
|
|
|
PRIVATE void objc_collect_garbage_data(void(*cleanup)(void*), void *garbage)
|
|
{
|
|
if (0 == garbage_queue)
|
|
{
|
|
LOCK_RUNTIME_FOR_SCOPE();
|
|
if (0 == garbage_queue)
|
|
{
|
|
garbage_queue = dispatch_queue_create("ObjC deferred free queue", 0);
|
|
}
|
|
}
|
|
dispatch_async_f(garbage_queue, garbage, cleanup);
|
|
}
|
|
|
|
#endif
|