mlua-rs/rlua

When is lua coroutine created by create_thread freed/destructed from memory?

surajprak opened this issue · 1 comments

I am having a single instance of rlua::Lua. I am iterating inside a future mpsc loop and in each iteration creating a coroutine using rlua create_thread. I want to understand few things

  1. what is the memory size allocated per coroutine and
  2. when is this coroutine object destructed? Is it destroyed when this coroutine completes?

create_thread is a simple wrapper over lua_newthread. The lua_newthread docs say:

There is no explicit function to close or to destroy a thread. Threads are subject to garbage collection, like any Lua object.