2024-02-09 02:48:44 -05:00
|
|
|
use crate::Os;
|
|
|
|
|
|
|
|
|
|
pub fn mimalloc(os: Os) -> &'static str {
|
|
|
|
|
const ALPINE_MIMALLOC: &str = r#"
|
2025-08-09 12:20:58 -04:00
|
|
|
FROM alpine:latest AS mimalloc-alpine
|
2024-02-09 02:48:44 -05:00
|
|
|
|
|
|
|
|
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 43ce4bd7fd34bcc730c1c7471c99995597415488 && \
|
|
|
|
|
mkdir -p out/secure && \
|
|
|
|
|
cd out/secure && \
|
|
|
|
|
cmake -DMI_SECURE=ON ../.. && \
|
|
|
|
|
make && \
|
|
|
|
|
cp ./libmimalloc-secure.so ../../../libmimalloc.so
|
|
|
|
|
"#;
|
|
|
|
|
|
|
|
|
|
const DEBIAN_MIMALLOC: &str = r#"
|
2025-08-10 11:34:09 -04:00
|
|
|
FROM debian:bullseye-slim AS mimalloc-debian
|
2024-02-09 02:48:44 -05:00
|
|
|
|
|
|
|
|
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 43ce4bd7fd34bcc730c1c7471c99995597415488 && \
|
|
|
|
|
mkdir -p out/secure && \
|
|
|
|
|
cd out/secure && \
|
|
|
|
|
cmake -DMI_SECURE=ON ../.. && \
|
|
|
|
|
make && \
|
|
|
|
|
cp ./libmimalloc-secure.so ../../../libmimalloc.so
|
|
|
|
|
"#;
|
|
|
|
|
|
|
|
|
|
match os {
|
|
|
|
|
Os::Alpine => ALPINE_MIMALLOC,
|
|
|
|
|
Os::Debian => DEBIAN_MIMALLOC,
|
|
|
|
|
}
|
|
|
|
|
}
|