mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-07-06 19:38:41 +03:00
add initial primitive api for locks
This commit is contained in:
parent
d9aa19a763
commit
0b3cd51249
11 changed files with 208 additions and 48 deletions
|
@ -19,7 +19,7 @@
|
|||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <Windows.h>
|
||||
#include <windows.h>
|
||||
static void msleep(unsigned long msecs) { Sleep(msecs); }
|
||||
#else
|
||||
#include <unistd.h>
|
||||
|
@ -43,7 +43,7 @@ static void test_stl_allocators();
|
|||
|
||||
int main() {
|
||||
// mi_stats_reset(); // ignore earlier allocations
|
||||
|
||||
|
||||
test_std_string();
|
||||
// heap_thread_free_huge();
|
||||
/*
|
||||
|
|
|
@ -200,7 +200,7 @@ static void test_stress(void) {
|
|||
#ifndef NDEBUG
|
||||
//mi_collect(false);
|
||||
//mi_debug_show_arenas();
|
||||
#endif
|
||||
#endif
|
||||
#if !defined(NDEBUG) || defined(MI_TSAN)
|
||||
if ((n + 1) % 10 == 0) { printf("- iterations left: %3d\n", ITER - (n + 1)); }
|
||||
#endif
|
||||
|
@ -232,7 +232,7 @@ static void test_leak(void) {
|
|||
int main(int argc, char** argv) {
|
||||
#ifndef USE_STD_MALLOC
|
||||
mi_stats_reset();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// > mimalloc-test-stress [THREADS] [SCALE] [ITER]
|
||||
if (argc >= 2) {
|
||||
|
@ -285,7 +285,7 @@ static void (*thread_entry_fun)(intptr_t) = &stress;
|
|||
|
||||
#ifdef _WIN32
|
||||
|
||||
#include <Windows.h>
|
||||
#include <windows.h>
|
||||
|
||||
static DWORD WINAPI thread_entry(LPVOID param) {
|
||||
thread_entry_fun((intptr_t)param);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue