rewrote for analloc2 perf rewrite