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

Use a static buffer for panic messages #41

Merged
merged 1 commit into from
Jan 30, 2023
Merged

Conversation

nick-mobilecoin
Copy link
Collaborator

Previously panic messages were using to_string() which required
allocating a string. Now a static buffer is used for building up the
panic message to prevent possibly panicking allocating the message
String.

Copy link
Contributor

@awygle awygle left a comment

Choose a reason for hiding this comment

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

LGTM.

Previously panic messages were using `to_string()` which required
allocating a string. Now a static buffer is used for building up the
panic message to prevent possibly panicking allocating the message
`String`.
@nick-mobilecoin
Copy link
Collaborator Author

@varsha888 bump for re-review due to restack

@nick-mobilecoin
Copy link
Collaborator Author

nick-mobilecoin commented Jan 30, 2023

✅ This pull request merged successfully as part of a Graphite job
Stack job ID: rnb0zcLhVk2UL31G5ihD.
See details on graphite.dev

Base automatically changed from nick/mutex to main January 30, 2023 23:50
@nick-mobilecoin nick-mobilecoin merged commit 6169325 into main Jan 30, 2023
@nick-mobilecoin nick-mobilecoin deleted the panic-buffer branch January 30, 2023 23:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rust Pull requests that update rust code size/L Large PRs
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants