-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Assert on proper alignment in dlmalloc #14634
Conversation
#endif | ||
|
||
#endif // __EMSCRIPTEN__ |
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.
This same code should be used in emmalloc too?
system/lib/emmalloc.cpp
Outdated
@@ -62,6 +63,9 @@ extern "C" | |||
// than this will yield an allocation with this much alignment. | |||
#define MALLOC_ALIGNMENT 8 |
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.
How about
#define MALLOC_ALIGNMENT alignof(max_align_t)
_Static_assert(alignof(max_align_t) == 8, "max_align_t must be correct");
Note that in C++ you can do alignof
rather than __alignof__
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.
Sure.
Fixes #10072