lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

> Date: Wed, 04 Jul 2012 00:24:34 +0200
> From: Carsten Fuchs <>
> Subject: Prevent userdata from being marked for garbage collection?
> my preferred way of binding C++ objects to Lua has always been the direct and
> lightweight way...
> A key feature of this approach is that Lua determines the lifetime of the C++ object...

In my update to LuaBridge, I added support for three styles of
"Lifetime Management" which directly address the use-cases you

- Lua lifetime: Managed completely by Lua
- C++ lifetime: Managed completely by C++
- Shared lifetime: Reference counted with your choice of compatible container.

These lifetime models are fully documented in the LuaBridge README:


The LuaBridge Demo graphical application (which works on most
platforms) has example code for creating objects using all the various
lifetime models, using the provided reference counted containers:

If you have questions feel free to contact me or open an Issue on Github.


Follow me on Github: