1
0
mirror of git://projects.qi-hardware.com/xburst-tools.git synced 2025-04-21 12:27:27 +03: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; 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");