Support multiple backends and add alloc backend

why this change? now it's inconsistent with the preceding two