Path: blob/main/system/lib/mimalloc/src/prim/prim.c
6178 views
/* ----------------------------------------------------------------------------1Copyright (c) 2018-2023, Microsoft Research, Daan Leijen2This is free software; you can redistribute it and/or modify it under the3terms of the MIT license. A copy of the license can be found in the file4"LICENSE" at the root of this distribution.5-----------------------------------------------------------------------------*/67// Select the implementation of the primitives8// depending on the OS.910#if defined(_WIN32)11#include "windows/prim.c" // VirtualAlloc (Windows)1213#elif defined(__APPLE__)14#include "osx/prim.c" // macOSX (actually defers to mmap in unix/prim.c)1516#elif defined(__wasi__)17#define MI_USE_SBRK18#include "wasi/prim.c" // memory-grow or sbrk (Wasm)1920#elif defined(__EMSCRIPTEN__)21#include "emscripten/prim.c" // emmalloc_*, + pthread support2223#else24#include "unix/prim.c" // mmap() (Linux, macOSX, BSD, Illumnos, Haiku, DragonFly, etc.)2526#endif272829