wrote implementation of DoubleBufferedAllocator