From 95933facfbc45f667f051440ceb374f16b051fcc Mon Sep 17 00:00:00 2001 From: Mitya Selivanov Date: Wed, 16 Apr 2025 12:22:44 +0200 Subject: Add test letter A --- reduced_system_layer.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'reduced_system_layer.c') diff --git a/reduced_system_layer.c b/reduced_system_layer.c index cd0a4a3..f34c03d 100755 --- a/reduced_system_layer.c +++ b/reduced_system_layer.c @@ -1498,6 +1498,7 @@ typedef struct { i64 begin_nsec; } Profiler_Slot_; +b8 _profiler_ready = 0; i64 _profiler_num_slots = 0; Profiler_Slot_ *_profiler_slots = NULL; @@ -1512,10 +1513,12 @@ void PROFILER_init(u32 slot, c8 *name) { mem_set_(_profiler_slots + slot, 0, sizeof *_profiler_slots); _profiler_slots[slot].name = name; + + _profiler_ready = 1; } void PROFILER_begin(u32 slot) { - if ((i64) (u64) slot >= _profiler_num_slots && slot == PROFILE_MEMORY) + if (!_profiler_ready) return; if ((i64) (u64) slot >= _profiler_num_slots) { @@ -1558,6 +1561,8 @@ static void normalize_time_(i64 *sec, i64 *nsec) { } void PROFILER_end(u32 slot) { + if (!_profiler_ready) + return; if ((i64) (u64) slot >= _profiler_num_slots) return; -- cgit v1.2.3