I just published a new article about Using C++ Templates to Implement Dynamic Memory Objects with Custom Allocator. By using these techniques you can separate functionality that uses custom memory management from the underlying memory semantics (heap, stack, shared memory, mapped memory, ...) as well as play with behavior of the allocation process itself.