2025-11-16 01:43:29 +09:00
|
|
|
|
/**
|
2025-12-05 15:31:44 +09:00
|
|
|
|
* hakmem_smallmid.h - Small-Mid Allocator Stub (archived implementation)
|
2025-11-16 01:43:29 +09:00
|
|
|
|
*
|
2025-12-05 15:31:44 +09:00
|
|
|
|
* 現在のコードベースでは SmallMid フロント/バックエンドは使用せず、
|
|
|
|
|
|
* Tiny/Tiny-Plus で 1KB までを処理します。
|
2025-11-16 01:43:29 +09:00
|
|
|
|
*
|
2025-12-05 15:31:44 +09:00
|
|
|
|
* ただし、既存の境界(hak_alloc_api / hakmem_tiny からの呼び出し)は維持するため、
|
|
|
|
|
|
* API だけを残した「常に無効な Stub Box」として定義します。
|
2025-11-16 01:43:29 +09:00
|
|
|
|
*
|
2025-12-05 15:31:44 +09:00
|
|
|
|
* 元の実装は archive/smallmid/ 以下に移動済みです。
|
2025-11-16 01:43:29 +09:00
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef HAKMEM_SMALLMID_H
|
|
|
|
|
|
#define HAKMEM_SMALLMID_H
|
|
|
|
|
|
|
|
|
|
|
|
#include <stddef.h>
|
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
|
extern "C" {
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
2025-12-05 15:31:44 +09:00
|
|
|
|
// 旧実装と互換の定数だけ残す(値は使われないがビルドを安定させる)
|
2025-11-16 01:51:43 +09:00
|
|
|
|
#define SMALLMID_NUM_CLASSES 3
|
2025-11-16 01:43:29 +09:00
|
|
|
|
|
2025-12-05 15:31:44 +09:00
|
|
|
|
// 便宜上の範囲定義(小さくしておくが、smallmid_is_enabled()==false なので実行はされない)
|
|
|
|
|
|
#define SMALLMID_MIN_SIZE (256)
|
|
|
|
|
|
#define SMALLMID_MAX_SIZE (1024)
|
2025-11-16 01:43:29 +09:00
|
|
|
|
|
2025-12-05 15:31:44 +09:00
|
|
|
|
// API スタブ
|
|
|
|
|
|
// 旧実装と互換のヘルパー(インライン宣言のみ、実体は stub .c で定義)
|
|
|
|
|
|
bool smallmid_is_in_range(size_t size);
|
2025-11-16 01:43:29 +09:00
|
|
|
|
|
|
|
|
|
|
void smallmid_init(void);
|
|
|
|
|
|
void* smallmid_alloc(size_t size);
|
|
|
|
|
|
void smallmid_free(void* ptr);
|
|
|
|
|
|
void smallmid_thread_exit(void);
|
|
|
|
|
|
|
2025-12-05 15:31:44 +09:00
|
|
|
|
// SmallMid が有効かどうか(現在は常に false を返す stub 実装)
|
2025-11-16 01:43:29 +09:00
|
|
|
|
bool smallmid_is_enabled(void);
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
|
}
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#endif // HAKMEM_SMALLMID_H
|