mirror of
git://projects.qi-hardware.com/xburst-tools.git
synced 2024-11-26 12:02:50 +02:00
qi-fix-malloc-alignment.patch
Noticed malloc() could become unaligned Signed-off-by: Andy Green <andy@openmoko.com>
This commit is contained in:
parent
4bdb43cc93
commit
b2995f8b39
@ -271,7 +271,7 @@ void *malloc(size_t size)
|
|||||||
{
|
{
|
||||||
void *p = malloc_pointer;
|
void *p = malloc_pointer;
|
||||||
|
|
||||||
malloc_pointer += size;
|
malloc_pointer += (size & ~3) + 4;
|
||||||
|
|
||||||
if (((u8 *)malloc_pointer - &malloc_pool[0]) > sizeof(malloc_pool)) {
|
if (((u8 *)malloc_pointer - &malloc_pool[0]) > sizeof(malloc_pool)) {
|
||||||
puts("Ran out of malloc pool\n");
|
puts("Ran out of malloc pool\n");
|
||||||
|
Loading…
Reference in New Issue
Block a user