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>
This commit is contained in:
32
core/hakmem_tiny_registry_api.h
Normal file
32
core/hakmem_tiny_registry_api.h
Normal file
@ -0,0 +1,32 @@
|
||||
#ifndef HAKMEM_TINY_REGISTRY_API_H
|
||||
#define HAKMEM_TINY_REGISTRY_API_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <pthread.h>
|
||||
|
||||
// Forward declarations
|
||||
struct TinySlab;
|
||||
typedef struct TinySlab TinySlab;
|
||||
|
||||
// Phase 2B-3: Registry Operations API
|
||||
// Hash table for slab ownership tracking
|
||||
|
||||
// Hash function for slab_base (64KB aligned) - static inline for cross-TU use
|
||||
#ifndef SLAB_REGISTRY_MASK
|
||||
#define SLAB_REGISTRY_MASK 0x7F // Assuming this is defined in hakmem_tiny.h
|
||||
#endif
|
||||
|
||||
static inline int registry_hash(uintptr_t slab_base) {
|
||||
return (slab_base >> 16) & SLAB_REGISTRY_MASK;
|
||||
}
|
||||
|
||||
// Register slab in hash table (returns 1 on success, 0 on failure)
|
||||
int registry_register(uintptr_t slab_base, TinySlab* owner);
|
||||
|
||||
// Unregister slab from hash table
|
||||
void registry_unregister(uintptr_t slab_base);
|
||||
|
||||
// Registry lock (extern from hakmem_tiny.c)
|
||||
extern pthread_mutex_t g_tiny_registry_lock;
|
||||
|
||||
#endif // HAKMEM_TINY_REGISTRY_API_H
|
||||
Reference in New Issue
Block a user