mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-08-24 16:24:47 +03:00
initial commit of new primitive layer
This commit is contained in:
parent
2e6ab0f230
commit
08a01d26dc
11 changed files with 1221 additions and 983 deletions
18
src/prim/prim.c
Normal file
18
src/prim/prim.c
Normal file
|
@ -0,0 +1,18 @@
|
|||
/* ----------------------------------------------------------------------------
|
||||
Copyright (c) 2018-2023, Microsoft Research, Daan Leijen
|
||||
This is free software; you can redistribute it and/or modify it under the
|
||||
terms of the MIT license. A copy of the license can be found in the file
|
||||
"LICENSE" at the root of this distribution.
|
||||
-----------------------------------------------------------------------------*/
|
||||
|
||||
// Select the implementation of the primitives
|
||||
// depending on the OS.
|
||||
|
||||
#if defined(_WIN32)
|
||||
#include "prim-windows.c" // VirtualAlloc (Windows)
|
||||
#elif defined(__wasi__)
|
||||
#define MI_USE_SBRK
|
||||
#include "prim-wasi.h" // memory-grow or sbrk (Wasm)
|
||||
#else
|
||||
#include "prim-unix.c" // mmap() (Linux, macOSX, BSD, Illumnos, Haiku, DragonFly, etc.)
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue