Skip to content

Commit 103530b

Browse files
committed
Downgrade to mimalloc 2.1.9
I don't know the exact reason, but it looks like newer versions of mimalloc has a problem with build reproducibility. Concretely, `dist.sh` produces different binaries for my local builds and on GitHub Actions.
1 parent f7b1920 commit 103530b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+697
-1796
lines changed

third-party/mimalloc/.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
build
21
ide/vs20??/*.db
32
ide/vs20??/*.opendb
43
ide/vs20??/*.user
@@ -9,5 +8,3 @@ docs/
98
*.zip
109
*.tar
1110
*.gz
12-
.vscode
13-
.DS_STore

third-party/mimalloc/CMakeLists.txt

Lines changed: 75 additions & 145 deletions
Large diffs are not rendered by default.

third-party/mimalloc/azure-pipelines.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,49 @@ jobs:
241241
workingDirectory: $(BuildType)
242242
displayName: CTest
243243

244+
- job:
245+
displayName: Ubuntu 20.04
246+
pool:
247+
vmImage:
248+
ubuntu-20.04
249+
strategy:
250+
matrix:
251+
Debug:
252+
CC: gcc
253+
CXX: g++
254+
BuildType: debug
255+
cmakeExtraArgs: -DCMAKE_BUILD_TYPE=Debug -DMI_DEBUG_FULL=ON
256+
Debug++:
257+
CC: gcc
258+
CXX: g++
259+
BuildType: debug-cxx
260+
cmakeExtraArgs: -DCMAKE_BUILD_TYPE=Debug -DMI_DEBUG_FULL=ON -DMI_USE_CXX=ON
261+
Debug Clang:
262+
CC: clang
263+
CXX: clang++
264+
BuildType: debug-clang
265+
cmakeExtraArgs: -DCMAKE_BUILD_TYPE=Debug -DMI_DEBUG_FULL=ON
266+
Debug++ Clang:
267+
CC: clang
268+
CXX: clang++
269+
BuildType: debug-clang-cxx
270+
cmakeExtraArgs: -DCMAKE_BUILD_TYPE=Debug -DMI_DEBUG_FULL=ON -DMI_USE_CXX=ON
271+
Release Clang:
272+
CC: clang
273+
CXX: clang++
274+
BuildType: release-clang
275+
cmakeExtraArgs: -DCMAKE_BUILD_TYPE=Release
276+
steps:
277+
- task: CMake@1
278+
inputs:
279+
workingDirectory: $(BuildType)
280+
cmakeArgs: .. $(cmakeExtraArgs)
281+
- script: make -j$(nproc) -C $(BuildType)
282+
displayName: Make
283+
- script: ctest --verbose --timeout 240
284+
workingDirectory: $(BuildType)
285+
displayName: CTest
286+
244287
- job:
245288
displayName: macOS 15 (Sequoia)
246289
pool:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
0 Bytes
Binary file not shown.
-3.5 KB
Binary file not shown.
0 Bytes
Binary file not shown.
-2 KB
Binary file not shown.

third-party/mimalloc/bin/minject.exe

-2 KB
Binary file not shown.
-1.5 KB
Binary file not shown.

third-party/mimalloc/bin/readme.md

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
# Windows Override
22

3-
<span id="override_on_windows">We use a separate redirection DLL to override mimalloc on Windows</span>
4-
such that we redirect all malloc/free calls that go through the (dynamic) C runtime allocator,
5-
including those from other DLL's or libraries. As it intercepts all allocation calls on a low level,
6-
it can be used on large programs that include other 3rd party components.
3+
<span id="override_on_windows">Dynamically overriding on mimalloc on Windows</span>
4+
is robust and has the particular advantage to be able to redirect all malloc/free calls
5+
that go through the (dynamic) C runtime allocator, including those from other DLL's or
6+
libraries. As it intercepts all allocation calls on a low level, it can be used reliably
7+
on large programs that include other 3rd party components.
78
There are four requirements to make the overriding work well:
89

910
1. Use the C-runtime library as a DLL (using the `/MD` or `/MDd` switch).
1011

11-
2. Link your program explicitly with the `mimalloc.dll.lib` export library for
12+
2. Link your program explicitly with the `mimalloc.lib` export library for
1213
the `mimalloc.dll` -- which contains all mimalloc functionality.
1314
To ensure the `mimalloc.dll` is actually loaded at run-time it is easiest
1415
to insert some call to the mimalloc API in the `main` function, like `mi_version()`
@@ -25,23 +26,6 @@ There are four requirements to make the overriding work well:
2526
list of the final executable (so it can intercept all potential allocations).
2627
You can use `minject -l <exe>` to check this if needed.
2728

28-
```csharp
29-
┌──────────────┐
30-
Your Program
31-
└────┬─────────┘
32-
33-
mi_version() ┌───────────────┐ ┌───────────────────────┐
34-
├──────────────►│ mimalloc.dll ├────►│ mimalloc-redirect.dll
35-
│ └──────┬────────┘ └───────────────────────┘
36-
│ ▼
37-
malloc() etc. ┌──────────────┐
38-
├──────────────►│ ucrtbase.dll
39-
│ └──────────────┘
40-
41-
42-
└──────────────► ...
43-
```
44-
4529
For best performance on Windows with C++, it
4630
is also recommended to also override the `new`/`delete` operations (by including
4731
[`mimalloc-new-delete.h`](../include/mimalloc-new-delete.h)

third-party/mimalloc/cmake/mimalloc-config-version.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
set(mi_version_major 2)
2-
set(mi_version_minor 2)
3-
set(mi_version_patch 2)
2+
set(mi_version_minor 1)
3+
set(mi_version_patch 9)
44
set(mi_version ${mi_version_major}.${mi_version_minor})
55

66
set(PACKAGE_VERSION ${mi_version})

third-party/mimalloc/contrib/docker/alpine-arm32v7/Dockerfile

Lines changed: 0 additions & 28 deletions
This file was deleted.

third-party/mimalloc/contrib/docker/alpine/Dockerfile

Lines changed: 0 additions & 23 deletions
This file was deleted.

third-party/mimalloc/contrib/docker/manylinux-x64/Dockerfile

Lines changed: 0 additions & 23 deletions
This file was deleted.

third-party/mimalloc/contrib/docker/readme.md

Lines changed: 0 additions & 10 deletions
This file was deleted.

third-party/mimalloc/contrib/vcpkg/portfile.cmake

Lines changed: 0 additions & 63 deletions
This file was deleted.

third-party/mimalloc/contrib/vcpkg/readme.md

Lines changed: 0 additions & 40 deletions
This file was deleted.

third-party/mimalloc/contrib/vcpkg/usage

Lines changed: 0 additions & 20 deletions
This file was deleted.

third-party/mimalloc/contrib/vcpkg/vcpkg-cmake-wrapper.cmake

Lines changed: 0 additions & 20 deletions
This file was deleted.

third-party/mimalloc/contrib/vcpkg/vcpkg.json

Lines changed: 0 additions & 45 deletions
This file was deleted.

0 commit comments

Comments
 (0)