Files
hakmem/core/box/shared_pool_box.h

19 lines
802 B
C
Raw Normal View History

#pragma once
// SharedPoolBox: 既存の g_shared_pool の上に「論理上限」を被せる軽量ラッパ。
// 目的:
// - HAKMEM_PROFILE=bench などのときに Shared Pool の増殖を論理的に抑える。
// - 配列サイズ自体は現状のままBSS をまだ縮めない)。
#include <stdint.h>
typedef struct SharedPoolBox SharedPoolBox;
// profile が NULL のときは HAKMEM_PROFILE を読む。
void shared_pool_box_init(SharedPoolBox* box, const char* profile);
// これ以上増やさない総枠。full では元の制限なし、bench では小さめ。
uint32_t shared_pool_effective_total_slots(void);
// クラス別の論理上限active slots がこの値を超えたら新規追加を抑制)
uint32_t shared_pool_effective_class_slots(int class_idx);