[riot-notifications] [RIOT-OS/RIOT] cpu/cortexm_common: add inlined header only def for irq_% (#13999)

Marian Buschsieweke notifications at github.com
Mon May 11 10:31:05 CEST 2020

> Thas huge! In #13825 we were concerned about a 1% drop, and here we improve 22%!

I think we could even get another gain of at least 5% if we optimized for the common case. E.g. something link:

static inline void mutex_lock(mutex_t *mutex)
    unsigned irqstate = irq_disable();
    /* Tell compiler to expect the if condition to be mostly true */
    if (__builtin_expect((mutex->queue.next == NULL), 1)) {
        /* Common case: Mutex is unlocked */
        mutex->queue.next = MUTEX_LOCKED;
        return 1;

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20200511/724f558d/attachment.htm>

More information about the notifications mailing list