generated from bitsquid_dt/dt-plugin-template
Add Development Notes
parent
f96e0e263c
commit
dbaad29b2a
1 changed files with 6 additions and 0 deletions
6
Development-Notes.md
Normal file
6
Development-Notes.md
Normal file
|
@ -0,0 +1,6 @@
|
|||
## Lua's error handling breaks Rust's memory safety
|
||||
|
||||
Since Lua utilizes `longjmp` for error handling and stack unwinding, any Lua error that crosses a Rust stack frame is going to lead to memory leaks from skipping `drop`s and to borrow checker constraints being broken.
|
||||
|
||||
The problem is that many Lua functions create errors internally. Some of them cannot be avoided (e.g. OOM), but wherever possible, per-conditions need to be checked such that Lua does not `longjmp`.
|
||||
E.g. a `lua.tostring` must be preceded by a `lua.isstring`.
|
Loading…
Add table
Add a link
Reference in a new issue