List of intended memory-management policies (note: the actual policies are below, after both kinds of modifiers):
structure modifiers:
- relative - own address is added to make effective pointer. Useful for
realloc
andmemcpy
, as well as shared memory. - middle_pointer - actually points to the middle of an object, with a known way to find the start
- note particularly how this interacts with subclasses. Possibly that should be the only way to create such a pointer? It isn't too crazy to synthesize a subclass just for the CowString trick ...
- (other arithmetic tricks possible: base+scale+offset, with each of these possibly hard-coded (which requires that there be multiple copies of some ownership policies! we can't just use an enum) or possibly embedded)
- (but what about "object is stored in a file too large to mmap" and such? Or should those only satisfy "ChunkyRandomIterator" concept?)