1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Index: apps/codecs/libtremor/oggmalloc.c
===================================================================
--- apps/codecs/libtremor/oggmalloc.c  (revision 28624)
+++ apps/codecs/libtremor/oggmalloc.c  (working copy)
@@ -61,7 +61,7 @@
 }

 /* Allocate IRAM buffer */
-static unsigned char iram_buff[IRAM_IBSS_SIZE] IBSS_ATTR __attribute__ ((aligned (16)));
+static unsigned char iram_buff[IRAM_IBSS_SIZE] IBSS_ATTR MEM_ALIGN_ATTR;
 static size_t iram_remain;

 void iram_malloc_init(void){
@@ -71,9 +71,9 @@
 void *iram_malloc(size_t size){
     void* x;

-    /* always ensure 16-byte aligned */
-    if(size&0x0f)
-      size=(size-(size&0x0f))+16;
+    /* always ensure alignment to CACHEALIGN_SIZE byte */
+    if(size&(CACHEALIGN_SIZE-1))
+      size=(size-(size&(CACHEALIGN_SIZE-1)))+CACHEALIGN_SIZE;

     if(size>iram_remain)
       return NULL;