How to do custom allocators

Have you looked at the deque implementation in DataStructures.jl?
I think it uses the same idea.