summaryrefslogtreecommitdiffstats
path: root/old-configure
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-10-19 00:09:27 +0200
committerwm4 <wm4@nowhere>2014-10-19 05:51:25 +0200
commitdaab65693c4994ea350f6dcfcf43653c57175ea5 (patch)
tree8cff6b2fd83ab6a57dd1aa400ba6651750ce52b2 /old-configure
parent76af31b0eb51d50f7dc17db3fdb3cc3e40fac187 (diff)
downloadmpv-daab65693c4994ea350f6dcfcf43653c57175ea5.tar.bz2
mpv-daab65693c4994ea350f6dcfcf43653c57175ea5.tar.xz
lua: add a helper to auto-free temporary C memory
Using the Lua API is a big PITA because it uses longjmp() error handling. That is, a Lua API function could any time raise an error and longjmp() to a lower part of the stack. This kind of "exception handling" is completely foreign to C, and there are no proper ways to clean up the "skipped" stack frames. Other than avoiding such situations entirely, the only way to deal with this is using Lua "userdata", which is basically a malloc'ed data block managed by the Lua GC, and which can have a destructor function associated (__gc metamethod). This requires an awful lot of code (because the Lua API is just so terrible), so I avoided this utnil now. But it looks like this will make some of the following commits much easier, so here we go.
Diffstat (limited to 'old-configure')
0 files changed, 0 insertions, 0 deletions