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

Handle allocation errors in UI layer #20

Open
martinfouilleul opened this issue Oct 9, 2023 · 0 comments
Open

Handle allocation errors in UI layer #20

martinfouilleul opened this issue Oct 9, 2023 · 0 comments

Comments

@martinfouilleul
Copy link
Collaborator

Imported from gitea. See https://git.handmade.network/hmn/orca/issues/155 for previous conversation

UI currently calls arena functions without checking the result. It is reasonable to expect that 1MB of memory is enough for most cases but it would be nice to explicitly log an error and crash. This behavior should also be documented - in Zig arena allocation can return explicit errors, and UI functions don't expose errors which can make the user think it can't fail. API-wise, the UI code is better off without error propagation (except on init), it just needs to fail fast and document that it'll do so.

This came out of #154

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

No branches or pull requests

1 participant