@@ -943,9 +943,10 @@ <h2 id="callback">Callbacks</h2>
943
943
< p >
944
944
However, this heuristic may fail under specific circumstances: e.g. a
945
945
message 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
949
950
< a href ="ext_jit.html#jit_onoff_func "> < tt > jit.off()</ tt > </ a > for the
950
951
surrounding Lua function that invokes such a message polling function (or
951
952
similar).
@@ -1038,9 +1039,9 @@ <h3 id="callback_performance">Callback performance</h3>
1038
1039
GUI application, which waits for user input most of the time, anyway.
1039
1040
</ p >
1040
1041
< 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
1044
1045
to C via the FFI are much faster than the other way round. Most well-designed
1045
1046
libraries already use pull-style APIs (read/write, get/put).
1046
1047
</ p >
0 commit comments