mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 20:29:23 +00:00
Allows us to update mimalloc and enable the newly added guard pages. Conflict identified by @PlasmaPower.
37 lines
1.0 KiB
Rust
37 lines
1.0 KiB
Rust
use crate::Os;
|
|
|
|
pub fn mimalloc(os: Os) -> &'static str {
|
|
const ALPINE_MIMALLOC: &str = r#"
|
|
FROM alpine:latest AS mimalloc-alpine
|
|
|
|
RUN apk update && apk upgrade && apk --no-cache add gcc g++ libc-dev make cmake git
|
|
RUN git clone https://github.com/microsoft/mimalloc && \
|
|
cd mimalloc && \
|
|
git checkout fbd8b99c2b828428947d70fdc046bb55609be93e && \
|
|
mkdir -p out/secure && \
|
|
cd out/secure && \
|
|
cmake -DMI_SECURE=ON -DMI_GUARDED=on ../.. && \
|
|
make && \
|
|
cp ./libmimalloc-secure.so ../../../libmimalloc.so
|
|
"#;
|
|
|
|
const DEBIAN_MIMALLOC: &str = r#"
|
|
FROM debian:trixie-slim AS mimalloc-debian
|
|
|
|
RUN apt update && apt upgrade -y && apt install -y gcc g++ make cmake git
|
|
RUN git clone https://github.com/microsoft/mimalloc && \
|
|
cd mimalloc && \
|
|
git checkout fbd8b99c2b828428947d70fdc046bb55609be93e && \
|
|
mkdir -p out/secure && \
|
|
cd out/secure && \
|
|
cmake -DMI_SECURE=ON -DMI_GUARDED=on ../.. && \
|
|
make && \
|
|
cp ./libmimalloc-secure.so ../../../libmimalloc.so
|
|
"#;
|
|
|
|
match os {
|
|
Os::Alpine => ALPINE_MIMALLOC,
|
|
Os::Debian => DEBIAN_MIMALLOC,
|
|
}
|
|
}
|