Fix C7 warm/TLS Release path and unify debug instrumentation

This commit is contained in:
Moe Charm (CI)
2025-12-05 23:41:01 +09:00
parent 96c2988381
commit d17ec46628
29 changed files with 1314 additions and 123 deletions

View File

@ -19,6 +19,7 @@
#define TINY_ROUTE_BOX_H
#include <stdint.h>
#include <stdio.h>
// Routing policy per Tiny class.
typedef enum {
@ -43,8 +44,21 @@ void tiny_route_init(void);
// Uses simple array lookup; class_idx is masked to [0,7] defensively.
static inline TinyRoutePolicy tiny_route_get(int class_idx)
{
return (TinyRoutePolicy)g_tiny_route[class_idx & 7];
TinyRoutePolicy p = (TinyRoutePolicy)g_tiny_route[class_idx & 7];
#if HAKMEM_BUILD_RELEASE
if ((class_idx & 7) == 7) {
static int rel_route_logged = 0;
if (!rel_route_logged) {
const char* mode =
(p == ROUTE_TINY_ONLY) ? "TINY_ONLY" :
(p == ROUTE_TINY_FIRST) ? "TINY_FIRST" :
(p == ROUTE_POOL_ONLY) ? "POOL_ONLY" : "UNKNOWN";
fprintf(stderr, "[REL_C7_ROUTE] via tiny_route_get route=%s\n", mode);
rel_route_logged = 1;
}
}
#endif
return p;
}
#endif // TINY_ROUTE_BOX_H