Merge pull request #220 from cormacrelf/usable_size

Don't call mi_page_usable_size_of with an aligned pointer
This commit is contained in:
Daan 2020-04-06 08:05:34 -07:00 committed by GitHub
commit 1ece3ff6aa
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 4 deletions

View file

@ -152,6 +152,9 @@ int main() {
}
result = ok;
});
CHECK_BODY("malloc-aligned5", {
void* p = mi_malloc_aligned(4097,4096); size_t usable = mi_usable_size(p); result = usable >= 4097 && usable < 10000; mi_free(p);
});
CHECK_BODY("malloc-aligned-at1", {
void* p = mi_malloc_aligned_at(48,32,0); result = (p != NULL && ((uintptr_t)(p) + 0) % 32 == 0); mi_free(p);
});