Templatize on allocate and deallocate method
Templatize on allocate and deallocate method

Former-commit-id: a387c80ee8ff6cfc7209a562bac178fc9df0029d
Trass3r/Halide,Trass3r/Halide,darkbuck/Halide,darkbuck/Halide,darkbuck/Halide,Trass3r/Halide,Trass3r/Halide,Trass3r/Halide,darkbuck/Halide,Trass3r/Halide,darkbuck/Halide,darkbuck/Halide,darkbuck/Halide,Trass3r/Halide