Infrastructure and build updates
- Update build configuration and flags - Add missing header files and dependencies - Update TLS list implementation with proper scoping - Fix various compilation warnings and issues - Update debug ring and tiny allocation infrastructure - Update benchmark results documentation Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
This commit is contained in:
@ -46,30 +46,38 @@ static inline uint32_t route_sample_mask(void) {
|
||||
return (g_route_sample_lg >= 31) ? 0xFFFFFFFFu : ((1u << g_route_sample_lg) - 1u);
|
||||
}
|
||||
|
||||
#define ROUTE_BEGIN(cls) do { \
|
||||
if (__builtin_expect(!route_enabled_runtime(), 1)) { g_route_active = 0; break; } \
|
||||
uint32_t m = route_sample_mask(); \
|
||||
uint32_t s = ++g_route_seq; \
|
||||
g_route_active = ((s & m) == 0u); \
|
||||
g_route_fp = 0ull; \
|
||||
(void)(cls); \
|
||||
} while(0)
|
||||
#if HAKMEM_BUILD_RELEASE && !HAKMEM_ROUTE
|
||||
#define ROUTE_BEGIN(cls) do { (void)(cls); } while(0)
|
||||
#define ROUTE_MARK(bit) do { (void)(bit); } while(0)
|
||||
#define ROUTE_COMMIT(cls, tag) do { (void)(cls); (void)(tag); } while(0)
|
||||
static inline void route_free_commit(int class_idx, uint64_t bits, uint16_t tag) {
|
||||
(void)class_idx; (void)bits; (void)tag;
|
||||
}
|
||||
#else
|
||||
#define ROUTE_BEGIN(cls) do { \
|
||||
if (__builtin_expect(!route_enabled_runtime(), 1)) { g_route_active = 0; break; } \
|
||||
uint32_t m = route_sample_mask(); \
|
||||
uint32_t s = ++g_route_seq; \
|
||||
g_route_active = ((s & m) == 0u); \
|
||||
g_route_fp = 0ull; \
|
||||
(void)(cls); \
|
||||
} while(0)
|
||||
|
||||
#define ROUTE_MARK(bit) do { if (__builtin_expect(g_route_active, 0)) { g_route_fp |= (1ull << (bit)); } } while(0)
|
||||
#define ROUTE_MARK(bit) do { if (__builtin_expect(g_route_active, 0)) { g_route_fp |= (1ull << (bit)); } } while(0)
|
||||
|
||||
#define ROUTE_COMMIT(cls, tag) do { \
|
||||
if (__builtin_expect(g_route_active, 0)) { \
|
||||
uintptr_t aux = ((uintptr_t)(tag & 0xFFFF) << 48) | (uintptr_t)(g_route_fp & 0x0000FFFFFFFFFFFFull); \
|
||||
tiny_debug_ring_record(TINY_RING_EVENT_ROUTE, (uint16_t)(cls), (void*)(uintptr_t)g_route_fp, aux); \
|
||||
g_route_active = 0; \
|
||||
} \
|
||||
} while(0)
|
||||
#define ROUTE_COMMIT(cls, tag) do { \
|
||||
if (__builtin_expect(g_route_active, 0)) { \
|
||||
uintptr_t aux = ((uintptr_t)(tag & 0xFFFF) << 48) | (uintptr_t)(g_route_fp & 0x0000FFFFFFFFFFFFull); \
|
||||
tiny_debug_ring_record(TINY_RING_EVENT_ROUTE, (uint16_t)(cls), (void*)(uintptr_t)g_route_fp, aux); \
|
||||
g_route_active = 0; \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
// Free-side one-shot route commit (independent of alloc-side COMMIT)
|
||||
static inline void route_free_commit(int class_idx, uint64_t bits, uint16_t tag) {
|
||||
if (!route_enabled_runtime()) return;
|
||||
uintptr_t aux = ((uintptr_t)(tag & 0xFFFF) << 48) | (uintptr_t)(bits & 0x0000FFFFFFFFFFFFull);
|
||||
tiny_debug_ring_record(TINY_RING_EVENT_ROUTE, (uint16_t)class_idx, (void*)(uintptr_t)bits, aux);
|
||||
}
|
||||
static inline void route_free_commit(int class_idx, uint64_t bits, uint16_t tag) {
|
||||
if (!route_enabled_runtime()) return;
|
||||
uintptr_t aux = ((uintptr_t)(tag & 0xFFFF) << 48) | (uintptr_t)(bits & 0x0000FFFFFFFFFFFFull);
|
||||
tiny_debug_ring_record(TINY_RING_EVENT_ROUTE, (uint16_t)class_idx, (void*)(uintptr_t)bits, aux);
|
||||
}
|
||||
#endif
|
||||
|
||||
// Note: Build-time gate removed to keep integration simple; runtime env controls activation.
|
||||
|
||||
Reference in New Issue
Block a user