diff options
Diffstat (limited to 'apps/codecs/libtremor/oggmalloc.c')
-rw-r--r-- | apps/codecs/libtremor/oggmalloc.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/apps/codecs/libtremor/oggmalloc.c b/apps/codecs/libtremor/oggmalloc.c index ca917ff397..4aa2760629 100644 --- a/apps/codecs/libtremor/oggmalloc.c +++ b/apps/codecs/libtremor/oggmalloc.c | |||
@@ -1,5 +1,10 @@ | |||
1 | #include "os_types.h" | 1 | #include "os_types.h" |
2 | 2 | ||
3 | #if defined(CPU_ARM) || defined(CPU_COLDFIRE) | ||
4 | #include <setjmp.h> | ||
5 | extern jmp_buf rb_jump_buf; | ||
6 | #endif | ||
7 | |||
3 | static size_t tmp_ptr; | 8 | static size_t tmp_ptr; |
4 | 9 | ||
5 | void ogg_malloc_init(void) | 10 | void ogg_malloc_init(void) |
@@ -16,7 +21,11 @@ void *ogg_malloc(size_t size) | |||
16 | size = (size + 3) & ~3; | 21 | size = (size + 3) & ~3; |
17 | 22 | ||
18 | if (mem_ptr + size > tmp_ptr) | 23 | if (mem_ptr + size > tmp_ptr) |
24 | #if defined(CPU_ARM) || defined(CPU_COLDFIRE) | ||
25 | longjmp(rb_jump_buf, 1); | ||
26 | #else | ||
19 | return NULL; | 27 | return NULL; |
28 | #endif | ||
20 | 29 | ||
21 | x = &mallocbuf[mem_ptr]; | 30 | x = &mallocbuf[mem_ptr]; |
22 | mem_ptr += size; /* Keep memory 32-bit aligned */ | 31 | mem_ptr += size; /* Keep memory 32-bit aligned */ |