fix this to work with allocators that have reference type with compilers