Skip to content

[core] Simplify ErrorHandler implementation #19395

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

silverweed
Copy link
Contributor

The current implementation uses a stack-allocated buffer + an optionally- allocated thread local heap buffer for vsnprintf. This likely was made to avoid heap allocating whenever not necessary (i.e. in the majority of cases).
However, a subsequent commit introduced a string bp that always performs the copy anyway. At this point the code can be simplified to avoid the double buffer and simply allocate straight into the string avoiding an extra copy.

The current implementation uses a stack-allocated buffer + an optionally-
allocated thread local heap buffer for vsnprintf. This likely was made
to avoid heap allocating whenever not necessary (i.e. in the majority
of cases).
However, a subsequent commit introduced a string `bp` that always performs
the copy anyway. At this point the code can be simplified to avoid the
double buffer and simply allocate straight into the string avoiding an
extra copy.
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.

1 participant