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

Show better description to users when std::bad_alloc happens #13783

Merged
merged 1 commit into from Sep 13, 2023

Conversation

sfan5
Copy link
Member

@sfan5 sfan5 commented Sep 5, 2023

"minetest crashed with std::bad_alloc, what does that mean" is a recurring user support question

To do

This PR is Ready for Review.

How to test

  1. put while (true) memset(new int[100000000ul], 1, 4096); into some unsuspecting part.
  2. run
  3. wait for error to appear

Copy link
Member

@grorp grorp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a good idea. The implementation works.

src/debug.cpp Show resolved Hide resolved
@sfan5 sfan5 merged commit 033128d into minetest:master Sep 13, 2023
13 checks passed
@sfan5 sfan5 deleted the error_friendly branch September 13, 2023 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants