unarr: support a custom memory allocator