Do not bump to large size for page aligned request

This commit is contained in:
Yinan Zhang
2020-08-25 14:30:37 -07:00
parent 8a56d6b636
commit b35ac00d58
2 changed files with 11 additions and 4 deletions

View File

@@ -288,7 +288,7 @@ sz_sa2u(size_t size, size_t alignment) {
assert(alignment != 0 && ((alignment - 1) & alignment) == 0);
/* Try for a small size class. */
if (size <= SC_SMALL_MAXCLASS && alignment < PAGE) {
if (size <= SC_SMALL_MAXCLASS && alignment <= PAGE) {
/*
* Round size up to the nearest multiple of alignment.
*