Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Core] Dynamic or runtime-configurable maximum element count #102

Open
leduyquang753 opened this issue Dec 24, 2024 · 2 comments
Open

[Core] Dynamic or runtime-configurable maximum element count #102

leduyquang753 opened this issue Dec 24, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@leduyquang753
Copy link

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

@nicbarker nicbarker changed the title Dynamic or runtime-configurable maximum element count [Core] Dynamic or runtime-configurable maximum element count Dec 24, 2024
@nicbarker
Copy link
Owner

100% agree on this one, I will have a PR up tomorrow to switch the define to a runtime configurable value, with an error hook function to notify the user when the memory has been exhausted 🙂

@nicbarker nicbarker added the enhancement New feature or request label Dec 24, 2024
@nicbarker nicbarker self-assigned this Dec 24, 2024
@nicbarker
Copy link
Owner

This will be addressed with #105 when it's merged!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants