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 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