-
Notifications
You must be signed in to change notification settings - Fork 108
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
Remove some unneeded headers #680
base: main
Are you sure you want to change the base?
Conversation
f1e86d7
to
f88be6f
Compare
This removes some unneeded headers from the headers.
This stack allocates and copies a c-string to replace the calls to std::string.
f88be6f
to
63cfb65
Compare
src/snmalloc/ds_core/redblacktree.h
Outdated
auto s_indent = std::string(indent); | ||
print(get_dir(true, curr), (s_indent + "|").c_str(), depth + 1); | ||
print(get_dir(false, curr), (s_indent + " ").c_str(), depth + 1); | ||
char s_indent[128]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why 128? - Also you might want to use a scoped constant, like enum { size = 128 }; char s_indent[size]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SamuelMarks thanks for your code review. I've added a comment to explain the bound, and made a constexpr
for the constant.
9eb7735
to
ac23f54
Compare
Towards #670.