clay
clay copied to clipboard
[Core] Dynamic or runtime-configurable maximum element count
The current way of handling memory allocation through a fixed CLAY_MAX_ELEMENT_COUNT
macro constant has two major issues:
- The UI may become larger than expected (for example a very long list of files) and there is no way to react to this at runtime.
- If the macro is set to a large value in anticipation of such situations, memory would be wasted most of the time when those cases are rare.
Support should be added for either a more flexible memory allocation solution that adapts to the current number of elements (the library tells the user when to reallocate), or a reconfigurable maximum number of elements during runtime (the user code recognizes the exhaustion and reallocates).