Boxify superslab registry, add bench profile, and document C7 hotpath experiments
This commit is contained in:
@ -7,6 +7,8 @@
|
||||
#include "superslab/superslab_inline.h" // superslab_ref_get guard for TLS pins
|
||||
#include "box/ss_release_guard_box.h" // Box: SuperSlab Release Guard
|
||||
#include "box/ss_slab_reset_box.h" // Box: Reset slab metadata on reuse path
|
||||
#include "box/ss_stats_box.h" // Observability: Superslab/slab counters
|
||||
#include "box/ss_budget_box.h" // Budget guard (global/class caps)
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
@ -217,6 +219,8 @@ shared_pool_release_slab(SuperSlab* ss, int slab_idx)
|
||||
slab_meta->class_idx = 255; // UNASSIGNED
|
||||
// P1.1: Mark class_map as UNASSIGNED when releasing slab
|
||||
ss->class_map[slab_idx] = 255;
|
||||
// Reset slab metadata to a pristine state for all classes (C0–C7)
|
||||
ss_slab_reset_meta_for_tiny(ss, slab_idx, -1);
|
||||
|
||||
if (ss->active_slabs > 0) {
|
||||
ss->active_slabs--;
|
||||
@ -284,6 +288,8 @@ shared_pool_release_slab(SuperSlab* ss, int slab_idx)
|
||||
|
||||
// Free SuperSlab immediately (bypasses normal active_slots==0 check)
|
||||
extern void superslab_free(SuperSlab* ss);
|
||||
ss_stats_on_ss_free_class(class_idx);
|
||||
ss_budget_on_free(class_idx);
|
||||
superslab_free(ss);
|
||||
return;
|
||||
}
|
||||
@ -321,6 +327,8 @@ shared_pool_release_slab(SuperSlab* ss, int slab_idx)
|
||||
// If so, we must NOT free the SS.
|
||||
if (ss_release_guard_superslab_can_free(ss)) {
|
||||
extern void superslab_free(SuperSlab* ss);
|
||||
ss_stats_on_ss_free_class(class_idx);
|
||||
ss_budget_on_free(class_idx);
|
||||
superslab_free(ss);
|
||||
} else {
|
||||
#if !HAKMEM_BUILD_RELEASE
|
||||
|
||||
Reference in New Issue
Block a user