mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-07-06 19:38:41 +03:00
fix alignment issue #700
This commit is contained in:
parent
90f866c5bc
commit
4bf63300b3
4 changed files with 31 additions and 2 deletions
|
@ -20,6 +20,7 @@ static void negative_stat(void);
|
|||
static void alloc_huge(void);
|
||||
static void test_heap_walk(void);
|
||||
static void test_heap_arena(void);
|
||||
static void test_align(void);
|
||||
|
||||
int main() {
|
||||
mi_version();
|
||||
|
@ -37,6 +38,7 @@ int main() {
|
|||
// alloc_huge();
|
||||
// test_heap_walk();
|
||||
// test_heap_arena();
|
||||
test_align();
|
||||
|
||||
void* p1 = malloc(78);
|
||||
void* p2 = malloc(24);
|
||||
|
@ -68,6 +70,13 @@ int main() {
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void test_align() {
|
||||
void* p = mi_malloc_aligned(256, 256);
|
||||
if (((uintptr_t)p % 256) != 0) {
|
||||
fprintf(stderr, "%p is not 256 alignend!\n", p);
|
||||
}
|
||||
}
|
||||
|
||||
static void invalid_free() {
|
||||
free((void*)0xBADBEEF);
|
||||
realloc((void*)0xBADBEEF,10);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue