Ran into the same problem with macroexpand that prevented TCO in
step5. Apparently objects as parameters cannot be re-assigning (or
copied and re-assigned even) in a loop. When trying to do so, the
server process crashes with a memory error.
Move away from try to allocate and pass full structures around.
Instead pass integer references into a memory pool of the objects
(nested table of mal objects) and then pass this memory pool around by
reference. Passing the memory pool around all over the place is ugly,
but it allows TCO and macroexpand to work at all and seems to have
better performance anyways.