One problem with LuaJIT is its tendency to aggressively gc CDEF'd objects. The only ways to stop this behavior seem to be turning the JIT compiler off, or using a C backing array. This makes it difficult to use SDL3's properties API to store tile pointers by (not necessarily consecutive) id because gc will eat them. The best I could do was have a backing array of tiles and map ids to indices in the properties.
OR... or... store each object in its own array...







