When executing lua code in 'restricted mode' calling C API functions not annotated with EXTL_SAFE produces a 'Attempt to call an unsafe function "...." in restricted mode' warning.
We should document when lua code runs in 'restricted mode' and when it is acceptable to annotate a C function with EXTL_SAFE.
Anonymous
ioncore_current seems like a good candidate for EXTL_SAFE, but I'm reluctant to add it without properly understanding what the issue is here.
I think a function has to be considered unsafe when it can alter a list that any of our foo_i functions could iterate over. For example when calling mplex:managed_i(fn), the function fn must not alter the list of managed regions of mplex because it could thereby violate assumptions that the code of WMPlex.managed_i relies on.
I've added some documentation in libextl/3387b2203cbb25818958a4b14c39cdc444dd325e and notion-doc/180422475c5f8cd64cbb3e804024d2dabd97976f
Any comments or suggestions? :)