Skip to main content

next_thunks

Function next_thunks 

Source
pub fn next_thunks() -> (*const c_void, *const c_void, *mut *const c_void, *mut *const c_void)
Expand description

Take the next unused thunk pair.

Callers used to pass an index they had chosen by reading the other call sites, which is a collision waiting to happen — two key paths sharing a pair would dispatch to whichever was built last, with nothing to say so. Each key path is built once and caches its result, so handing them out in order is enough.