We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 065cdad commit 11a3aabCopy full SHA for 11a3aab
1 file changed
Src/HALAL/Services/Time/Scheduler.cpp
@@ -121,11 +121,7 @@ inline uint64_t Scheduler::get_global_tick() { return global_tick_us_; }
121
// void Scheduler::global_timer_callback() { on_timer_update(); }
122
123
inline uint8_t Scheduler::allocate_slot() {
124
- /* https://developer.arm.com/documentation/dui0204/j/arm-and-thumb-instructions/general-data-processing-instructions/clz
125
- * clz(0) = 32 -> 32 - clz(0) = 0
126
- * clz(0xFFFF'FFFF) = 0 -> 32 - clz(0xFFFF'FFFF) > kMaxTasks
127
- */
128
- uint32_t idx = __builtin_ffs(~Scheduler::free_bitmap_) - 1;
+ uint32_t idx = __builtin_ffs(Scheduler::free_bitmap_) - 1;
129
if(idx > static_cast<int>(Scheduler::kMaxTasks)) [[unlikely]]
130
return static_cast<uint8_t>(Scheduler::INVALID_ID);
131
Scheduler::active_task_count_++;
0 commit comments