microsoft/qdk

Public

mirrored fromhttps://github.com/microsoft/qdkAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
alex/katas-update

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

allocator/mimalloc-sys/mimalloc/src/prim/prim.c

24lines · modecode

1/* ----------------------------------------------------------------------------
2Copyright (c) 2018-2023, Microsoft Research, Daan Leijen
3This is free software; you can redistribute it and/or modify it under the
4terms of the MIT license. A copy of the license can be found in the file
5"LICENSE" at the root of this distribution.
6-----------------------------------------------------------------------------*/
7
8// Select the implementation of the primitives
9// depending on the OS.
10
11#if defined(_WIN32)
12#include "windows/prim.c" // VirtualAlloc (Windows)
13
14#elif defined(__APPLE__)
15#include "osx/prim.c" // macOSX (actually defers to mmap in unix/prim.c)
16
17#elif defined(__wasi__)
18#define MI_USE_SBRK
19#include "wasi/prim.c" // memory-grow or sbrk (Wasm)
20
21#else
22#include "unix/prim.c" // mmap() (Linux, macOSX, BSD, Illumnos, Haiku, DragonFly, etc.)
23
24#endif
25