Moe Charm (CI)
0c0d9c8c0b
Unify Unified Cache API to BASE-only pointer type with Phantom typing
Core Changes:
- Modified: core/front/tiny_unified_cache.h
* API signatures changed to use hak_base_ptr_t (Phantom type)
* unified_cache_pop() returns hak_base_ptr_t (was void*)
* unified_cache_push() accepts hak_base_ptr_t base (was void*)
* unified_cache_pop_or_refill() returns hak_base_ptr_t (was void*)
* Added #include "../box/ptr_type_box.h" for Phantom types
- Modified: core/front/tiny_unified_cache.c
* unified_cache_refill() return type changed to hak_base_ptr_t
* Uses HAK_BASE_FROM_RAW() for wrapping return values
* Uses HAK_BASE_TO_RAW() for unwrapping parameters
* Maintains internal void* storage in slots array
- Modified: core/box/tiny_front_cold_box.h
* Uses hak_base_ptr_t from unified_cache_refill()
* Uses hak_base_is_null() for NULL checks
* Maintains tiny_user_offset() for BASE→USER conversion
* Cold path refill integration updated to Phantom types
- Modified: core/front/malloc_tiny_fast.h
* Free path wraps BASE pointer with HAK_BASE_FROM_RAW()
* When pushing to Unified Cache via unified_cache_push()
Design Rationale:
- Unified Cache API now exclusively handles BASE pointers (no USER mixing)
- Phantom types enforce type distinction at compile time (debug mode)
- Zero runtime overhead in Release mode (macros expand to identity)
- Hot paths (tiny_hot_alloc_fast, tiny_hot_free_fast) remain unchanged
- Layout consistency maintained via tiny_user_offset() Box
Validation:
- All 25 Phantom type usage sites verified (25/25 correct)
- HAK_BASE_FROM_RAW(): 5/5 correct wrappings
- HAK_BASE_TO_RAW(): 1/1 correct unwrapping
- hak_base_is_null(): 4/4 correct NULL checks
- Compilation: RELEASE=0 and RELEASE=1 both successful
- Smoke tests: 3/3 passed (simple_alloc, loop 10M, pool_tls)
Type Safety Benefits:
- Prevents USER/BASE pointer confusion at API boundaries
- Compile-time checking in debug builds via Phantom struct
- Zero cost abstraction in release builds
- Clear intent: Unified Cache exclusively stores BASE pointers
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 12:20:21 +09:00
..
2025-11-09 18:55:50 +09:00
2025-11-09 18:55:50 +09:00
2025-11-07 01:27:04 +09:00
2025-12-03 12:11:27 +09:00
2025-11-30 05:12:32 +09:00
2025-11-20 07:32:30 +09:00
2025-12-03 10:34:39 +09:00
2025-11-13 01:45:30 +09:00
2025-11-29 07:57:49 +09:00
2025-12-03 13:28:44 +09:00
2025-11-13 01:45:30 +09:00
2025-11-29 09:04:32 +09:00
2025-12-01 16:05:55 +09:00
2025-12-01 13:47:23 +09:00
2025-11-30 15:27:53 +09:00
2025-12-01 16:37:59 +09:00
2025-11-07 01:27:04 +09:00
2025-12-03 10:34:39 +09:00
2025-11-07 01:27:04 +09:00
2025-11-21 23:00:24 +09:00
2025-11-26 12:33:49 +09:00
2025-12-01 16:37:59 +09:00
2025-12-04 04:58:22 +09:00
2025-12-03 13:28:44 +09:00
2025-12-04 04:58:22 +09:00
2025-12-03 12:11:27 +09:00
2025-12-03 10:34:39 +09:00
2025-11-17 02:47:58 +09:00
2025-11-15 22:08:51 +09:00
2025-11-27 03:41:07 +09:00
2025-11-16 07:51:37 +09:00
2025-11-26 17:12:41 +09:00
2025-12-03 20:42:28 +09:00
2025-12-03 20:42:28 +09:00
2025-11-07 01:27:04 +09:00
2025-12-04 11:58:37 +09:00
2025-11-07 01:27:04 +09:00
2025-12-02 19:13:28 +09:00
2025-12-04 12:06:14 +09:00
2025-11-20 07:32:30 +09:00
2025-12-03 10:34:39 +09:00
2025-11-12 02:45:00 +09:00
2025-11-28 16:08:44 +09:00
2025-12-03 10:34:39 +09:00
2025-11-07 01:27:04 +09:00
2025-11-29 14:39:07 +09:00
2025-11-17 02:47:58 +09:00
2025-11-17 02:47:58 +09:00
2025-11-17 02:47:58 +09:00
2025-12-01 22:06:10 +09:00
2025-12-01 22:06:10 +09:00
2025-11-06 21:54:12 +09:00
2025-11-06 21:54:12 +09:00
2025-11-06 21:54:12 +09:00
2025-11-07 01:27:04 +09:00
2025-11-07 01:27:04 +09:00
2025-11-07 01:27:04 +09:00
2025-11-07 01:27:04 +09:00
2025-11-07 01:27:04 +09:00
2025-11-06 21:54:12 +09:00
2025-11-20 07:32:30 +09:00
2025-12-03 10:34:39 +09:00
2025-11-13 01:45:30 +09:00
2025-12-03 17:18:31 +09:00
2025-11-28 13:42:39 +09:00
2025-12-01 16:37:59 +09:00
2025-11-22 03:30:47 +09:00
2025-11-30 07:16:50 +09:00
2025-12-04 06:22:09 +09:00
2025-11-30 10:48:50 +09:00
2025-11-20 07:32:30 +09:00
2025-11-20 07:32:30 +09:00
2025-11-30 07:16:50 +09:00
2025-11-30 07:16:50 +09:00
2025-12-03 21:56:52 +09:00
2025-11-20 07:32:30 +09:00
2025-11-20 07:32:30 +09:00
2025-11-20 07:32:30 +09:00
2025-12-02 19:43:23 +09:00
2025-11-28 14:11:37 +09:00
2025-11-17 05:29:08 +09:00
2025-12-03 10:34:39 +09:00
2025-11-16 05:48:59 +09:00
2025-11-20 07:32:30 +09:00
2025-11-20 07:32:30 +09:00
2025-12-04 06:22:09 +09:00
2025-11-20 07:32:30 +09:00
2025-11-20 07:32:30 +09:00
2025-11-22 02:46:57 +09:00
2025-11-20 07:32:30 +09:00
2025-11-20 07:32:30 +09:00
2025-12-03 20:42:28 +09:00
2025-12-03 20:42:28 +09:00
2025-11-28 13:42:39 +09:00
2025-11-26 12:33:49 +09:00
2025-11-12 02:45:00 +09:00
2025-11-29 08:44:29 +09:00
2025-11-30 11:06:44 +09:00
2025-12-04 12:06:14 +09:00
2025-12-02 16:16:51 +09:00
2025-12-02 16:16:51 +09:00
2025-12-04 11:58:37 +09:00
2025-12-04 12:20:21 +09:00
2025-12-03 12:43:02 +09:00
2025-12-03 17:18:31 +09:00
2025-11-30 10:48:50 +09:00
2025-11-30 10:48:50 +09:00
2025-12-03 11:38:11 +09:00
2025-12-03 12:11:27 +09:00
2025-11-20 07:32:30 +09:00
2025-11-20 07:32:30 +09:00
2025-11-28 13:42:39 +09:00
2025-12-04 05:54:54 +09:00
2025-11-20 07:32:30 +09:00
2025-11-20 07:32:30 +09:00
2025-11-20 07:32:30 +09:00
2025-11-28 13:42:39 +09:00
2025-12-04 10:38:19 +09:00
2025-12-02 23:29:07 +09:00
2025-12-03 18:06:24 +09:00
2025-11-22 06:50:38 +09:00
2025-11-17 02:47:58 +09:00
2025-12-03 13:28:44 +09:00
2025-11-17 02:47:58 +09:00
2025-12-02 19:13:28 +09:00
2025-12-02 19:13:28 +09:00