[opus] Global stack on Cortex-M4

Thomas Daede tdaede at mozilla.com
Wed Oct 18 21:00:36 UTC 2017


On 10/18/2017 01:40 PM, Eric wrote:

> Secondly; With the "overide" directives above no dynamic memory
> allocation is supposed to happen. However, the following call chain
> (obviously)  cause a crash:
> 
> opus_encode(..)->
> opus_encode_native(..)->ALLOC_STACK->opus_alloc_scratch(..)->opus_alloc(..)

NONTHREADSAFE_PSEUDOSTACK requires a working allocator. You should
select either vararrays or alloca(). Both should work on any gcc-based
Cortex-M toolchain. (For that matter, malloc() and free() should work
fine too, unless you have other reasons to avoid them)


More information about the opus mailing list