clay icon indicating copy to clipboard operation
clay copied to clipboard

[Core] Dynamic or runtime-configurable maximum element count

Open leduyquang753 opened this issue 2 months ago • 2 comments

The current way of handling memory allocation through a fixed CLAY_MAX_ELEMENT_COUNT macro constant has two major issues:

  1. 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.
  2. 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).

leduyquang753 avatar Dec 24 '24 17:12 leduyquang753