1
0
mirror of git://projects.qi-hardware.com/xburst-tools.git synced 2024-12-23 17:59:32 +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:
Andy Green 2008-11-28 10:16:38 +00:00 committed by Andy Green
parent 4bdb43cc93
commit b2995f8b39

View File

@ -271,7 +271,7 @@ void *malloc(size_t size)
{
void *p = malloc_pointer;
malloc_pointer += size;
malloc_pointer += (size & ~3) + 4;
if (((u8 *)malloc_pointer - &malloc_pool[0]) > sizeof(malloc_pool)) {
puts("Ran out of malloc pool\n");