alloc: remove encode limit arg, and implement free array cache.