Should I worry about Lua Registry overflow?

Hi.

When we develop a native plugin that receives a callback function, we must store a reference to that callback lua function (that we get from luaState) inside the lua registry, so we can later retrieve it and use it. 

I was wondering if I can get an overflow of that Lua Registry if I never  " unref" those references that I put there.

One concrete case would be a plugin that waits for an external input. So I call that plugin (from my lua side) but the external input never arrives (and so the callback is not called and therefore my code that does the “unref” is never executed). Since the callback function was not executed, I will call my plugin again and I will keep doing that until I get a response (which would be my “callback” function being called).

The registry is just a table (see here and here in the source).

The registry API functions are thin wrappers over operations on this table using its integer keys, i.e. the refs. (Obviously you shouldn’t use your own integer keys manually or you risk botching this subsystem.)

The registry is just a table (see here and here in the source).

The registry API functions are thin wrappers over operations on this table using its integer keys, i.e. the refs. (Obviously you shouldn’t use your own integer keys manually or you risk botching this subsystem.)