3 ms·
They could just use a secondary manually allocated executable stack with pointers and data stored in thread-local variables. Anyway, normally in C interfaces t
by devit 7y ago
They could just use a secondary manually allocated executable stack with pointers and data stored in thread-local variables.
Anyway, normally in C interfaces that take a callback also take a pointer-sized value to pass to the callback, precisely to avoid having to generate code dynamically like this, so this feature shouldn't be that prevalent.
For example, glibc has a qsort_r function that works like that.