Remove legacy redundant code after Gatekeeper Box consolidation
Summary of Deletions:
- Remove core/box/unified_batch_box.c (26 lines)
* Legacy batch allocation logic superseded by Alloc Gatekeeper Box
* unified_cache now handles allocation aggregation
- Remove core/box/unified_batch_box.h (29 lines)
* Header declarations for deprecated unified_batch_box module
- Remove core/tiny_free_fast.inc.h (329 lines)
* Legacy fast-path free implementation
* Functionality consolidated into:
- tiny_free_gate_box.h (Fail-Fast layer + diagnostics)
- malloc_tiny_fast.h (Free path integration)
- unified_cache (return to freelist)
* Code path now routes through Gatekeeper Box for consistency
Build System Updates:
- Update Makefile
* Remove unified_batch_box.o from OBJS_BASE
* Remove unified_batch_box_shared.o from SHARED_OBJS
* Remove unified_batch_box.o from BENCH_HAKMEM_OBJS_BASE
- Update core/hakmem_tiny_phase6_wrappers_box.inc
* Remove unified_batch_box references
* Simplify allocation wrapper to use new Gatekeeper architecture
Impact:
- Removes ~385 lines of redundant/superseded code
- Consolidates allocation logic through unified Gatekeeper entry points
- All functionality preserved via new Box-based architecture
- Simplifies codebase and reduces maintenance burden
Testing:
- Build verification: make clean && make RELEASE=0/1
- Smoke tests: All pass (simple_alloc, loop 10M, pool_tls)
- No functional regressions
Rationale:
After implementing Alloc/Free Gatekeeper Boxes with Fail-Fast layers
and Unified Cache type safety, the legacy separate implementations
became redundant. This commit completes the architectural consolidation
and simplifies the allocator codebase.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@ -10,9 +10,6 @@
|
||||
// Box 5: Allocation Fast Path (Layer 1 - 3-4 instructions)
|
||||
#include "tiny_alloc_fast.inc.h"
|
||||
|
||||
// Box 6: Free Fast Path (Layer 2 - 2-3 instructions)
|
||||
#include "tiny_free_fast.inc.h"
|
||||
|
||||
// ---------------- Refill count (Front) global config ----------------
|
||||
// Parsed once at init; hot path reads plain ints (no getenv).
|
||||
int g_refill_count_global = 0; // HAKMEM_TINY_REFILL_COUNT
|
||||
@ -82,19 +79,15 @@
|
||||
}
|
||||
|
||||
void hak_tiny_free_fast_wrapper(void* ptr) {
|
||||
// Phase E5: Ultra fast path (6-8 instruction free)
|
||||
#if HAKMEM_ULTRA_FAST_PATH
|
||||
tiny_free_fast_ultra(ptr);
|
||||
return;
|
||||
#endif
|
||||
|
||||
static _Atomic uint64_t free_call_count = 0;
|
||||
uint64_t call_num = atomic_fetch_add(&free_call_count, 1);
|
||||
if (call_num > 14135 && call_num < 14145) {
|
||||
fprintf(stderr, "[HAK_TINY_FREE_FAST_WRAPPER] call=%lu ptr=%p\n", call_num, ptr);
|
||||
fflush(stderr);
|
||||
}
|
||||
tiny_free_fast(ptr);
|
||||
// Box 6 v1 (tiny_free_fast) は v2 に置き換え済み。
|
||||
// Wrapper からは Box 経路の slow/fast 判定に委ねる。
|
||||
hak_tiny_free(ptr);
|
||||
if (call_num > 14135 && call_num < 14145) {
|
||||
fprintf(stderr, "[HAK_TINY_FREE_FAST_WRAPPER] call=%lu completed\n", call_num);
|
||||
fflush(stderr);
|
||||
|
||||
Reference in New Issue
Block a user