Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ jobs:
# 只发头,不发 .so —— 消费者把实现体编进自己的 TU。
mkdir -p "$d/include"
cp -R include/. "$d/include/"
find build -maxdepth 3 \( -name 'lib*.so*' -o -name 'lib*.dylib' \) -exec cp -P {} "$d/lib/" \;
# 本仓无可执行产物(纯库),故不带 bin/
printf '{"abi":"%s"}\n' "$v" > "$d/abi-manifest.json"
tar czf "$d.tar.gz" "$d"
Expand Down
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ target_compile_definitions(slotsboxmalloc PRIVATE
$<$<CONFIG:Debug>:ENABLE_LOG>
)

target_link_libraries(slotsboxmalloc PUBLIC blockmalloc)
# 依赖 blockmalloc 走 header-only(src/slotsboxmalloc.c 里 #define *_IMPLEMENTATION),
# 故不链接它的 .so;头的搜索路径由系统 include 提供。

add_subdirectory(tutorial)

Expand Down
5 changes: 3 additions & 2 deletions ci/deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ for repo in $(jq -r 'keys[]' "$ROOT/deps.json"); do
gh release download "$ver" -R "array2d/$repo" -p "${repo}-abi-*-linux-x86_64.tar.gz" -D "$tmp"
tar xzf "$tmp"/*.tar.gz -C "$tmp" --strip-components=1
if [ -d "$tmp/include" ]; then sudo cp -r "$tmp/include/"* /usr/include/; fi
sudo cp "$tmp/lib/"*.so* /usr/lib/
# 依赖(blockmalloc)是 header-only:只发头、无 lib
if [ -d "$tmp/lib" ]; then sudo cp "$tmp/lib/"*.so* /usr/lib/; fi
rm -rf "$tmp"
done
echo "✅ ABI deps → /usr/lib + /usr/include"
echo "✅ ABI deps → /usr/include(+ 有 lib 的仓装 /usr/lib)"
4 changes: 4 additions & 0 deletions src/slotsboxmalloc.c
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
/* header-only:两个依赖的实现体都在本 TU 编译(不再链接 blockmalloc 的 .so)。
* blockmalloc 必须先于 slotsboxmalloc —— 后者实现体调用前者。 */
#define BLOCKMALLOC_IMPLEMENTATION
#include <blockmalloc/blockmalloc.h>
#define SLOTSBOXMALLOC_IMPLEMENTATION
#include "slotsboxmalloc/slotsboxobj.h"
Loading