Which is - estimate number of tables you might have simultaneously, multiply by some safety factor, preallocate these chunks of memory (statically if you like) and then manage their use yourself. You save the mallocs while still maintaining isolation. IOW, create a pool of tables - make each member of the pool the size of the largest table.
For extra fun - build it so it dynamically allocates more tables if the pool runs out but never free any of them - just mark them for reuse.