summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2010-09-26 12:56:02 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2010-09-26 12:56:02 +0000
commitdcc0d7dfdc88778169c542ec714094b068d8ff70 (patch)
treec353823edfad7785dbe188e7c665fe1246724625 /lib
parent74dbb3c27b4dfd40bc15886d4b198e8326d9ecf5 (diff)
downloadrockbox-dcc0d7dfdc88778169c542ec714094b068d8ff70.tar.gz
rockbox-dcc0d7dfdc88778169c542ec714094b068d8ff70.zip
fiddle with the alloc requested size instead of the buffer pointer to keep the buffer 32bit aligned
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28175 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'lib')
-rw-r--r--lib/skin_parser/skin_buffer.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/skin_parser/skin_buffer.c b/lib/skin_parser/skin_buffer.c
index 69d9d273bd..ecfe04b167 100644
--- a/lib/skin_parser/skin_buffer.c
+++ b/lib/skin_parser/skin_buffer.c
@@ -45,12 +45,12 @@ void* skin_buffer_alloc(size_t size)
{
void *retval = NULL;
#ifdef ROCKBOX
+ /* 32-bit aligned */
+ size = (size + 3) & ~3;
if (size > skin_buffer_freespace())
return NULL;
retval = buffer_front;
buffer_front += size;
- /* 32-bit aligned */
- buffer_front = (void *)(((unsigned long)buffer_front + 3) & ~3);
#else
retval = malloc(size);
#endif