Add lunatik objects to README#340
Draft
sneaky-potato wants to merge 1 commit intoluainkernel:masterfrom
Draft
Conversation
Signed-off-by: Ashwani Kumar Kamal <ashwanikamal.im421@gmail.com>
lneto
reviewed
Dec 22, 2025
|
|
||
| The lifetime of an object is not tied solely to Lua garbage collection. An object remains alive as long as at least one reference exists. | ||
|
|
||
| Some objects expose an explicit *stop* or *close* operation, which releases internal resources (such as Lua states or kernel hooks) before the object itself is freed. |
Contributor
There was a problem hiding this comment.
"Lua states" seems misleading here.. see https://www.lua.org/manual/5.4/manual.html#lua_State
lneto
reviewed
Dec 22, 2025
|
|
||
| Lua garbage collection may release Lua references to an object, but this does not necessarily destroy the underlying kernel object. Garbage collection typically results in a reference counter decrement. | ||
|
|
||
| Kernel-held references keep the object alive even after all Lua references are gone. For deterministic cleanup, objects should be explicitly stopped or unloaded when appropriate. |
lneto
reviewed
Dec 22, 2025
| Lunatik exposes kernel facilities to Lua through *objects*. A Lunatik object is a Lua userdata that represents a kernel-resident resource and is shared between Lua and C code. | ||
|
|
||
| Internally, each Lunatik object combines: | ||
| - a Lua userdata |
Contributor
There was a problem hiding this comment.
per runtime, right? each object might correspond to many userdata.
Contributor
|
@sneaky-potato are you still working on this? |
Member
Author
|
Hi @lneto , yes. I’ve been a bit caught up with other work lately, but I haven’t dropped it and will resume once things free up. Thanks for checking! I will mark the PR as draft for now. |
Contributor
No worries, I'm just planning the next release.. thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #183