Files
hakmem/core/hakmem_tiny_magazine.h
Moe Charm (CI) 52386401b3 Debug Counters Implementation - Clean History
Major Features:
- Debug counter infrastructure for Refill Stage tracking
- Free Pipeline counters (ss_local, ss_remote, tls_sll)
- Diagnostic counters for early return analysis
- Unified larson.sh benchmark runner with profiles
- Phase 6-3 regression analysis documentation

Bug Fixes:
- Fix SuperSlab disabled by default (HAKMEM_TINY_USE_SUPERSLAB)
- Fix profile variable naming consistency
- Add .gitignore patterns for large files

Performance:
- Phase 6-3: 4.79 M ops/s (has OOM risk)
- With SuperSlab: 3.13 M ops/s (+19% improvement)

This is a clean repository without large log files.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-05 12:31:14 +09:00

46 lines
1.2 KiB
C

#ifndef HAKMEM_TINY_MAGAZINE_H
#define HAKMEM_TINY_MAGAZINE_H
#include "hakmem_tiny.h" // For TINY_NUM_CLASSES
// This forward declaration is needed because TinyMagItem references it.
struct TinySlab;
#define TINY_TLS_MAG_CAP 2048
// Optional: store owner slab pointer alongside pointer in Magazine items
#ifndef HAKMEM_TINY_MAG_OWNER
#define HAKMEM_TINY_MAG_OWNER 1
#endif
typedef struct {
void* ptr;
#if HAKMEM_TINY_MAG_OWNER
struct TinySlab* owner;
#endif
} TinyMagItem;
// Legacy magazines retained for slow path / compatibility (will gradually shrink)
typedef struct {
TinyMagItem items[TINY_TLS_MAG_CAP];
int top; // number of stored items
int cap; // adaptive capacity (<= TINY_TLS_MAG_CAP)
} TinyTLSMag;
// Defined in hakmem_tiny_magazine.c
extern __thread TinyTLSMag g_tls_mags[TINY_NUM_CLASSES];
extern int g_mag_cap_limit;
// Magazine capacity helpers
extern int g_mag_cap_override[TINY_NUM_CLASSES];
int tiny_effective_cap(int class_idx);
int tiny_default_cap(int class_idx);
int tiny_cap_max_for_class(int class_idx);
// Magazine initialization helpers
extern __thread int g_tls_small_mags_inited;
void tiny_mag_init_if_needed(int class_idx);
void tiny_small_mags_init_once(void);
#endif // HAKMEM_TINY_MAGAZINE_H