I have a memory interface that separates out acquiring address space from attaching backing store. (Under Linux the pool of address space managed by the interface is mmap'ed MAP_ANONYMOUS and MAP_NORESERVE, madvise'ed MADV_DONTNEED and mprotect'ed PROT_NONE. Backing is then attached by madvise MADV_WILLNEED and mprotect PROT_READ, PROT_WRITE and PROT_EXEC.)
This interface allows me to allocate a large amount of address space while lazily acquiring the actual physical memory. I would like to use this to create a "lazy vector" which makes requests for backing store at appropriate points but never copies the current contents of the vector as it grows.
Given the semantics of the standard library's allocators is such an scheme possible? Pointers, hints or other guidance gratefully accepted.