anchao commented on code in PR #17300:
URL: https://github.com/apache/nuttx/pull/17300#discussion_r2512617834
##########
sched/sched/sched_lock.c:
##########
@@ -76,13 +76,13 @@ void sched_lock(void)
* integer type.
*/
- DEBUGASSERT(rtcb == NULL || rtcb->lockcount < MAX_LOCK_COUNT);
+ DEBUGASSERT(rtcb && rtcb->lockcount < MAX_LOCK_COUNT);
Review Comment:
> but assert is better than exception directly
@xiaoxiang781216 @hujun260
Case 1:
1. 99.9% of cases will improve the performance by 1 cycle.
2. The assert becomes an exception.
Case 2:
1. 99.9% of cases will decrease the performance by 1 cycle.
2. The exception becomes an assert.
Which one would you like?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]