[riot-notifications] [RIOT-OS/RIOT] Preemption of malloc on AVR (#10842)
notifications at github.com
Wed Jan 23 18:14:52 CET 2019
To be honest, I would add an `assert()` in the pre_hook of `malloc()` to make sure it is called in thread-context and document that `malloc()` must not be called from interrupt context. I never did perform benchmark on `malloc()`, but I was told it can be quite costly and should not occur in hot code paths.
But if we decide to support `malloc()` in interrupt context, there will be no other option to disabling all interrupts. (One might be tempted to call `mutex_trylock()` form ISR instead of `mutex_lock()` and just let `malloc()` return `NULL` if `mutex_trylock()` fails, but as the hooks are `void`-Functions, this is not an option.)
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...
More information about the notifications