Skip to content

header-only:补 include guard;release 只发头 - #2

Merged
miaobyte merged 1 commit into
mainfrom
feat/header-only
Sep 14, 2026
Merged

miaobyte merged 1 commit into
mainfrom
feat/header-only

Conversation

@miaobyte

Copy link
Copy Markdown
Contributor

变更

1. 补 include guard(必须)

blockmalloc.h 原本没有 include guard;slotsboxmalloc 的实现体内部会再 include 它,二次 include 时 static inlinecpu_relax/spin_lock/…)直接重定义报错 —— 这是 header-only 用法的前提。

#pragma once 后,kvspace-c 走单头文件模式编译通过。

2. release 只发头

本库定位是单头文件(#define BLOCKMALLOC_IMPLEMENTATION),release 不再打包 .so。消费者把实现体编进自己的 TU。

🤖 Generated with Claude Code

- blockmalloc.h 缺 include guard → 二次 include 时 static inline 重定义
  (slotsboxmalloc 的实现体内部会再 include 它)
- release 不再打包 .so:本库定位是单头文件(#define
  BLOCKMALLOC_IMPLEMENTATION),消费者把实现体编进自己的 TU

Co-Authored-By: Claude Code <noreply@anthropic.com>
@miaobyte
miaobyte merged commit d265ae3 into main Sep 14, 2026
3 checks passed
@miaobyte
miaobyte deleted the feat/header-only branch September 15, 2026 06:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant