It would be nice if DataBlock would unload the data if it is not actively used. For example, OpenGL copies the data to a texture object or buffer object and then does not touch it anymore.

The application would have to register a callback that would reload the data on demand. Registering the callback would activate the feature for a DataBlock instance.

To implement this, there should be a data_ref field in DataBlock. Reindeer modules should use _begin_use when they are actively using the data, and _end_use when they are not anymore. The field data_ref is set to 1 at initialization to avoid repeatedly unload/reload each time a module wants the data only temporarily. The application should do _end_use when they believe it is okay. This is usually after one or a few frames when the data block has been used by all Reindeer contexts that need it.

Applications should only write data in the reload callback, and it must be the exact same data as previously (undefined behavior otherwise). The DataBlock becomes immutable. The reload callback gives the data pointer, the block size and user data (specified on registering the callback).

The use of the feature is only recommended when the data can be relatively quickly reloaded, or where it is known that it is unlikely to be reloaded anyway.