Skip to content

Fix argument order in std::aligned_alloc calls#8

Open
shaoyihao wants to merge 1 commit into
JunctionOS:mainfrom
shaoyihao:patch-1
Open

Fix argument order in std::aligned_alloc calls#8
shaoyihao wants to merge 1 commit into
JunctionOS:mainfrom
shaoyihao:patch-1

Conversation

@shaoyihao
Copy link
Copy Markdown

The C++ standard library specifies std::aligned_alloc(alignment, size). The previous implementation reversed these arguments, which passes the requested size as the alignment requirement (likely causing allocation failures if the size is not a power of two) and allocates the wrong amount of memory.

The C++ standard library specifies std::aligned_alloc(alignment, size). The previous implementation reversed these arguments, which passes the requested size as the alignment requirement (likely causing allocation failures if the size is not a power of two) and allocates the wrong amount of memory.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant