mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-07-06 19:38:41 +03:00
Merge branch 'dev' into dev-slice
This commit is contained in:
commit
62708b9843
6 changed files with 14 additions and 9 deletions
|
@ -212,6 +212,11 @@ int main(void) {
|
|||
result = mi_heap_contains_block(heap, p);
|
||||
mi_heap_destroy(heap);
|
||||
}
|
||||
CHECK_BODY("mimalloc-aligned12") {
|
||||
void* p = mi_malloc_aligned(0x100, 0x100);
|
||||
result = (((uintptr_t)p % 0x100) == 0); // #602
|
||||
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);
|
||||
};
|
||||
|
@ -286,7 +291,7 @@ int main(void) {
|
|||
// Larger test functions
|
||||
// ---------------------------------------------------
|
||||
|
||||
bool test_heap1() {
|
||||
bool test_heap1(void) {
|
||||
mi_heap_t* heap = mi_heap_new();
|
||||
int* p1 = mi_heap_malloc_tp(heap,int);
|
||||
int* p2 = mi_heap_malloc_tp(heap,int);
|
||||
|
@ -295,7 +300,7 @@ bool test_heap1() {
|
|||
return true;
|
||||
}
|
||||
|
||||
bool test_heap2() {
|
||||
bool test_heap2(void) {
|
||||
mi_heap_t* heap = mi_heap_new();
|
||||
int* p1 = mi_heap_malloc_tp(heap,int);
|
||||
int* p2 = mi_heap_malloc_tp(heap,int);
|
||||
|
@ -306,7 +311,7 @@ bool test_heap2() {
|
|||
return true;
|
||||
}
|
||||
|
||||
bool test_stl_allocator1() {
|
||||
bool test_stl_allocator1(void) {
|
||||
#ifdef __cplusplus
|
||||
std::vector<int, mi_stl_allocator<int> > vec;
|
||||
vec.push_back(1);
|
||||
|
@ -319,7 +324,7 @@ bool test_stl_allocator1() {
|
|||
|
||||
struct some_struct { int i; int j; double z; };
|
||||
|
||||
bool test_stl_allocator2() {
|
||||
bool test_stl_allocator2(void) {
|
||||
#ifdef __cplusplus
|
||||
std::vector<some_struct, mi_stl_allocator<some_struct> > vec;
|
||||
vec.push_back(some_struct());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue