I’m studying the supply code of libdispatch
and got here throughout the implementation of the _dispatch_client_callout
perform as follows:
#outline _dispatch_get_tsd_base()
#outline _dispatch_get_unwind_tsd() (NULL)
#outline _dispatch_set_unwind_tsd(u) do {(void)(u);} whereas (0)
#outline _dispatch_free_unwind_tsd()
#outline possible(x) __builtin_expect(!!(x), 1)
#outline unlikely(x) __builtin_expect(!!(x), 0)
void
_dispatch_client_callout(void *ctxt, dispatch_function_t f)
{
_dispatch_get_tsd_base();
void *u = _dispatch_get_unwind_tsd();
if (possible(!u)) return f(ctxt);
_dispatch_set_unwind_tsd(NULL);
f(ctxt);
_dispatch_free_unwind_tsd();
_dispatch_set_unwind_tsd(u);
}
Within the _dispatch_client_callout
perform, a sequence of macros are invoked, however these macros appear to have empty implementations, equivalent to:
#outline _dispatch_get_tsd_base()
#outline _dispatch_get_unwind_tsd() (NULL)
#outline _dispatch_set_unwind_tsd(u) do {(void)(u);} whereas (0)
#outline _dispatch_free_unwind_tsd()
Why is that this the case? What ought to the precise implementations of those macros appear like?