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:
parent
c255073fb8
commit
d6c381508e
1 changed files with 4 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue