1313-- src/free.c is #included BY alloc.c (`#include "free.c"`, alloc.c:22),
1414-- src/alloc-override.c likewise (alloc.c:21). Neither is a standalone TU.
1515--
16- -- The list below is upstream's own `mi_sources` (CMakeLists.txt:75-93), which is
17- -- the only authoritative answer to "which files are TUs".
16+ -- The list below is upstream's own `mi_sources` (CMakeLists.txt:75-93 in 3.4.5,
17+ -- 107-135 in 3.6.1), which is the only authoritative answer to "which files are
18+ -- TUs". The two releases lay the same library out differently, and one list
19+ -- names both layouts: a name that is not in a release's tree selects nothing
20+ -- there.
1821--
1922-- `src/prim/prim.c` is a dispatcher: it #includes the platform implementation
2023-- (prim/unix, prim/windows, prim/osx, …) for the host it is compiled on, so one
@@ -43,6 +46,13 @@ package = {
4346 },
4447 sha256 = " 19a43af0645c57d348e729d5b31e23e912582911bb1047f795790834d3416221" ,
4548 },
49+ [" 3.6.1" ] = {
50+ url = {
51+ GLOBAL = " https://github.com/microsoft/mimalloc/archive/refs/tags/v3.6.1.tar.gz" ,
52+ CN = " https://gitcode.com/mcpp-res/mimalloc/releases/download/3.6.1/mimalloc-3.6.1.tar.gz" ,
53+ },
54+ sha256 = " 2672e6a99d4579fb4bb32d9de0d63aa424ce600d31fbfaf06eb74d940d2e07a6" ,
55+ },
4656 },
4757 macosx = {
4858 [" 3.4.5" ] = {
@@ -52,6 +62,13 @@ package = {
5262 },
5363 sha256 = " 19a43af0645c57d348e729d5b31e23e912582911bb1047f795790834d3416221" ,
5464 },
65+ [" 3.6.1" ] = {
66+ url = {
67+ GLOBAL = " https://github.com/microsoft/mimalloc/archive/refs/tags/v3.6.1.tar.gz" ,
68+ CN = " https://gitcode.com/mcpp-res/mimalloc/releases/download/3.6.1/mimalloc-3.6.1.tar.gz" ,
69+ },
70+ sha256 = " 2672e6a99d4579fb4bb32d9de0d63aa424ce600d31fbfaf06eb74d940d2e07a6" ,
71+ },
5572 },
5673 windows = {
5774 [" 3.4.5" ] = {
@@ -61,6 +78,13 @@ package = {
6178 },
6279 sha256 = " 19a43af0645c57d348e729d5b31e23e912582911bb1047f795790834d3416221" ,
6380 },
81+ [" 3.6.1" ] = {
82+ url = {
83+ GLOBAL = " https://github.com/microsoft/mimalloc/archive/refs/tags/v3.6.1.tar.gz" ,
84+ CN = " https://gitcode.com/mcpp-res/mimalloc/releases/download/3.6.1/mimalloc-3.6.1.tar.gz" ,
85+ },
86+ sha256 = " 2672e6a99d4579fb4bb32d9de0d63aa424ce600d31fbfaf06eb74d940d2e07a6" ,
87+ },
6488 },
6589 },
6690
@@ -69,7 +93,14 @@ package = {
6993 import_std = false ,
7094 c_standard = " c11" ,
7195 include_dirs = { " */include" },
96+ -- Upstream builds as gnu11; this recipe builds as c11, under which a C
97+ -- library declares nothing beyond ISO C unless asked. 3.6.1's
98+ -- `prim/prim.c' includes headers before `prim/unix/prim.c' states
99+ -- `_DEFAULT_SOURCE' for itself, so `syscall' and `madvise' arrive
100+ -- undeclared; stating it for every unit is what gnu11 did.
101+ cflags = { " -D_DEFAULT_SOURCE" },
72102 sources = {
103+ -- 3.4.5: one directory.
73104 " */src/alloc.c" ,
74105 " */src/alloc-aligned.c" ,
75106 " */src/alloc-posix.c" ,
@@ -87,6 +118,37 @@ package = {
87118 " */src/stats.c" ,
88119 " */src/theap.c" ,
89120 " */src/threadlocal.c" ,
121+ -- 3.6.1: the same library in seven directories, and three units
122+ -- the earlier layout did not have (profile/). `alloc/free.c' and
123+ -- `alloc/alloc-override.c' are included by `alloc/alloc.c', as
124+ -- `free.c' was by `alloc.c'.
125+ " */src/prim/os.c" ,
126+ " */src/prim/prim-tls.c" ,
127+ " */src/util/libc.c" ,
128+ " */src/util/options.c" ,
129+ " */src/util/random.c" ,
130+ " */src/util/stats.c" ,
131+ " */src/util/threadlocal.c" ,
132+ " */src/arena/arena.c" ,
133+ " */src/arena/arena-alloc.c" ,
134+ " */src/arena/arena-page.c" ,
135+ " */src/arena/bitmap.c" ,
136+ " */src/arena/bitmap-chunk.c" ,
137+ " */src/alloc/alloc.c" ,
138+ " */src/alloc/alloc-generic.c" ,
139+ " */src/alloc/alloc-aligned.c" ,
140+ " */src/alloc/alloc-posix.c" ,
141+ " */src/alloc/page.c" ,
142+ " */src/alloc/page-queue.c" ,
143+ " */src/heap/heap.c" ,
144+ " */src/heap/process.c" ,
145+ " */src/heap/page-map.c" ,
146+ " */src/heap/subproc.c" ,
147+ " */src/heap/theap.c" ,
148+ " */src/profile/sample-guarded.c" ,
149+ " */src/profile/sample-profile.c" ,
150+ " */src/profile/pprof.c" ,
151+ -- Both.
90152 " */src/prim/prim.c" ,
91153 },
92154 targets = { [" mimalloc" ] = { kind = " lib" } },
0 commit comments