@@ -943,9 +943,10 @@ <h2 id="callback">Callbacks</h2>
943943< p >
944944However, this heuristic may fail under specific circumstances: e.g. a
945945message polling function might not run Lua callbacks right away and the call
946- gets JIT-compiled. If it later happens to call back into Lua, you'll get a
947- VM PANIC with the message < tt > "bad callback"</ tt > . Then you'll need to
948- manually turn off JIT-compilation with
946+ gets JIT-compiled. If it later happens to call back into Lua (e.g. a rarely
947+ invoked error callback), you'll get a VM PANIC with the message
948+ < tt > "bad callback"</ tt > . Then you'll need to manually turn off
949+ JIT-compilation with
949950< a href ="ext_jit.html#jit_onoff_func "> < tt > jit.off()</ tt > </ a > for the
950951surrounding Lua function that invokes such a message polling function (or
951952similar).
@@ -1038,9 +1039,9 @@ <h3 id="callback_performance">Callback performance</h3>
10381039GUI application, which waits for user input most of the time, anyway.
10391040</ p >
10401041< p >
1041- For new designs < b > avoid push-style APIs</ b > ( C function repeatedly
1042- calling a callback for each result) . Instead < b > use pull-style APIs</ b >
1043- ( call a C function repeatedly to get a new result) . Calls from Lua
1042+ For new designs < b > avoid push-style APIs</ b > : a C function repeatedly
1043+ calling a callback for each result. Instead < b > use pull-style APIs</ b > :
1044+ call a C function repeatedly to get a new result. Calls from Lua
10441045to C via the FFI are much faster than the other way round. Most well-designed
10451046libraries already use pull-style APIs (read/write, get/put).
10461047</ p >
0 commit comments