Always align allocated buffers on 32-bit boundaries

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10391 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Linus Nielsen Feltzing 2006-08-01 09:43:14 +00:00
parent c255073fb8
commit d6c381508e

View file

@ -31,7 +31,8 @@ unsigned char *audiobuf;
void buffer_init(void)
{
audiobuf = audiobuffer;
/* 32-bit aligned */
audiobuf = (void *)(((unsigned long)audiobuffer + 3) & ~3);
}
void *buffer_alloc(size_t size)
@ -39,5 +40,7 @@ void *buffer_alloc(size_t size)
void *retval = audiobuf;
audiobuf += size;
/* 32-bit aligned */;
audiobuf = (void *)(((unsigned long)audiobuf + 3) & ~3);
return retval;
}