mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-07-06 19:38:41 +03:00
merge from dev
This commit is contained in:
commit
2d52b967bc
9 changed files with 72 additions and 14 deletions
|
@ -7,7 +7,7 @@
|
|||
#include <vector>
|
||||
#include <thread>
|
||||
#include <mimalloc.h>
|
||||
// #include <mimalloc-new-delete.h>
|
||||
#include <mimalloc-new-delete.h>
|
||||
#include <mimalloc-override.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
|
@ -28,6 +28,7 @@ int main() {
|
|||
// heap_no_delete(); // issue #202
|
||||
// heap_late_free(); // issue #204
|
||||
// dangling_ptr_write();
|
||||
// padding_shrink(); // issue #209
|
||||
various_tests();
|
||||
mi_stats_print(NULL);
|
||||
return 0;
|
||||
|
@ -159,3 +160,18 @@ static void heap_late_free() {
|
|||
|
||||
t1.join();
|
||||
}
|
||||
|
||||
// issue #209
|
||||
static void* shared_p;
|
||||
static void alloc0(/* void* arg */)
|
||||
{
|
||||
shared_p = mi_malloc(8);
|
||||
}
|
||||
|
||||
void padding_shrink(void)
|
||||
{
|
||||
auto t1 = std::thread(alloc0);
|
||||
t1.join();
|
||||
mi_free(shared_p);
|
||||
}
|
||||
|
||||
|
|
|
@ -123,7 +123,7 @@ int main() {
|
|||
});
|
||||
CHECK_BODY("posix_memalign_nomem", {
|
||||
void* p = &p;
|
||||
int err = mi_posix_memalign(&p, sizeof(void*), SIZE_MAX);
|
||||
volatile int err = mi_posix_memalign(&p, sizeof(void*), SIZE_MAX);
|
||||
result = (err==ENOMEM && p==&p);
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue