From 6a5a1ffb931722c98323c6a15500988d9b4a4f08 Mon Sep 17 00:00:00 2001 From: "peng.li24" <734991033@qq.com> Date: Sat, 12 Sep 2026 18:49:37 +0800 Subject: [PATCH 1/2] =?UTF-8?q?ci:=20=E5=A2=9E=E5=8A=A0=20macOS=20?= =?UTF-8?q?=E6=9E=84=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit macos-latest 上源码构建依赖 blockmalloc(v0.1.4,macOS 无预编译 ABI)后 构建本仓并跑 ctest。 Co-Authored-By: Claude Code --- .github/workflows/ci-macos.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/ci-macos.yml diff --git a/.github/workflows/ci-macos.yml b/.github/workflows/ci-macos.yml new file mode 100644 index 0000000..fceda8f --- /dev/null +++ b/.github/workflows/ci-macos.yml @@ -0,0 +1,20 @@ +name: ci-macos +on: [push, pull_request] +jobs: + build: + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + - name: 构建依赖 blockmalloc(macOS 无预编译 ABI,从源码装) + run: | + git clone --depth 1 --branch v0.1.4 https://github.com/array2d/blockmalloc.git /tmp/blockmalloc + cmake -S /tmp/blockmalloc -B /tmp/blockmalloc/build \ + -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local + cmake --build /tmp/blockmalloc/build -j + sudo cmake --install /tmp/blockmalloc/build + - name: 构建 + run: | + cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local + cmake --build build -j + - name: 测试 + run: cd build && ctest --output-on-failure From ad76ad6ac07d2e224ce5b11a75f6d3b89b39fb56 Mon Sep 17 00:00:00 2001 From: "peng.li24" <734991033@qq.com> Date: Sat, 12 Sep 2026 18:57:04 +0800 Subject: [PATCH 2/2] =?UTF-8?q?tutorial:=20=5FPOSIX=5FC=5FSOURCE=20199309L?= =?UTF-8?q?=20=E2=86=92=20200809L=EF=BC=88macOS=20=E9=9C=80=20C99=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit _POSIX_C_SOURCE=199309L 时 macOS 的 只暴露到 POSIX-1993, snprintf 等 C99 函数不声明;clang 在 C99 下把隐式声明当 error(Linux glibc 仅警告,故此前未暴露)。10 个 bench tutorial 统一提到 200809L。 Co-Authored-By: Claude Code --- tutorial/07_bench_concurrent.c | 2 +- tutorial/08_bench_pure.c | 2 +- tutorial/09_bench_sharded.c | 2 +- tutorial/10_bench_diag.c | 2 +- tutorial/11_bench_shallow.c | 2 +- tutorial/12_bench_lock.c | 2 +- tutorial/13_bench_diag2.c | 2 +- tutorial/14_bench_alloc_only.c | 2 +- tutorial/15_bench_dedicated.c | 2 +- tutorial/16_bench_malloc.c | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tutorial/07_bench_concurrent.c b/tutorial/07_bench_concurrent.c index 92dc963..fa70fa2 100644 --- a/tutorial/07_bench_concurrent.c +++ b/tutorial/07_bench_concurrent.c @@ -1,4 +1,4 @@ -#define _POSIX_C_SOURCE 199309L +#define _POSIX_C_SOURCE 200809L #include #include #include diff --git a/tutorial/08_bench_pure.c b/tutorial/08_bench_pure.c index 06062f6..79f3072 100644 --- a/tutorial/08_bench_pure.c +++ b/tutorial/08_bench_pure.c @@ -1,4 +1,4 @@ -#define _POSIX_C_SOURCE 199309L +#define _POSIX_C_SOURCE 200809L #include #include #include diff --git a/tutorial/09_bench_sharded.c b/tutorial/09_bench_sharded.c index becf096..9aea88b 100644 --- a/tutorial/09_bench_sharded.c +++ b/tutorial/09_bench_sharded.c @@ -1,4 +1,4 @@ -#define _POSIX_C_SOURCE 199309L +#define _POSIX_C_SOURCE 200809L #include #include #include diff --git a/tutorial/10_bench_diag.c b/tutorial/10_bench_diag.c index 5605f96..90bb8a7 100644 --- a/tutorial/10_bench_diag.c +++ b/tutorial/10_bench_diag.c @@ -1,4 +1,4 @@ -#define _POSIX_C_SOURCE 199309L +#define _POSIX_C_SOURCE 200809L #include #include #include diff --git a/tutorial/11_bench_shallow.c b/tutorial/11_bench_shallow.c index 61e4a6a..3be2837 100644 --- a/tutorial/11_bench_shallow.c +++ b/tutorial/11_bench_shallow.c @@ -1,4 +1,4 @@ -#define _POSIX_C_SOURCE 199309L +#define _POSIX_C_SOURCE 200809L #include #include #include diff --git a/tutorial/12_bench_lock.c b/tutorial/12_bench_lock.c index ff5a1e0..e7d83d0 100644 --- a/tutorial/12_bench_lock.c +++ b/tutorial/12_bench_lock.c @@ -1,4 +1,4 @@ -#define _POSIX_C_SOURCE 199309L +#define _POSIX_C_SOURCE 200809L #include #include #include diff --git a/tutorial/13_bench_diag2.c b/tutorial/13_bench_diag2.c index d296581..43f908d 100644 --- a/tutorial/13_bench_diag2.c +++ b/tutorial/13_bench_diag2.c @@ -1,4 +1,4 @@ -#define _POSIX_C_SOURCE 199309L +#define _POSIX_C_SOURCE 200809L #include #include #include diff --git a/tutorial/14_bench_alloc_only.c b/tutorial/14_bench_alloc_only.c index e2c2962..41adcf4 100644 --- a/tutorial/14_bench_alloc_only.c +++ b/tutorial/14_bench_alloc_only.c @@ -1,4 +1,4 @@ -#define _POSIX_C_SOURCE 199309L +#define _POSIX_C_SOURCE 200809L #include #include #include diff --git a/tutorial/15_bench_dedicated.c b/tutorial/15_bench_dedicated.c index 0b45b63..ee10598 100644 --- a/tutorial/15_bench_dedicated.c +++ b/tutorial/15_bench_dedicated.c @@ -1,4 +1,4 @@ -#define _POSIX_C_SOURCE 199309L +#define _POSIX_C_SOURCE 200809L #include #include #include diff --git a/tutorial/16_bench_malloc.c b/tutorial/16_bench_malloc.c index 02103c2..428e60a 100644 --- a/tutorial/16_bench_malloc.c +++ b/tutorial/16_bench_malloc.c @@ -1,4 +1,4 @@ -#define _POSIX_C_SOURCE 199309L +#define _POSIX_C_SOURCE 200809L #include #include #include