[PATCH] use 8 byte alignment in _dl_malloc
Pandit Panburana
ppanbura at yahoo.com
Fri Feb 16 13:32:38 UTC 2007
Hi Atsushi,
Should this be controlled by a #define with default of 4 bytes and for those platform or architecture that need 8 bytes alignment can define what it needs.?
Regards,
-Pandit
----- Original Message ----
From: Atsushi Nemoto <anemo at mba.ocn.ne.jp>
To: uclibc at uclibc.org
Sent: Friday, February 16, 2007 3:16:40 AM
Subject: [PATCH] use 8 byte alignment in _dl_malloc
I found many unaligned access when using shared uClibc on mips
n32/n64. This patch fix this problem. I just increment alignment
value to 8 while I suppose it is not worth to do #ifdef here.
--- uClibc-20070214/ldso/ldso/ldso.c 2007-02-14 17:10:10.000000000 +0900
+++ uClibc/ldso/ldso/ldso.c 2007-02-16 16:47:48.000000000 +0900
@@ -950,10 +950,10 @@ void *_dl_malloc(int size)
_dl_malloc_addr += size;
/*
- * Align memory to 4 byte boundary. Some platforms require this,
+ * Align memory to 8 byte boundary. Some platforms require this,
* others simply get better performance.
*/
- _dl_malloc_addr = (unsigned char *) (((unsigned long) _dl_malloc_addr + 3) & ~(3));
+ _dl_malloc_addr = (unsigned char *) (((unsigned long) _dl_malloc_addr + 7) & ~(7));
return retval;
}
_______________________________________________
uClibc mailing list
uClibc at uclibc.org
http://busybox.net/cgi-bin/mailman/listinfo/uclibc
____________________________________________________________________________________
Expecting? Get great news right away with email Auto-Check.
Try the Yahoo! Mail Beta.
http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.busybox.net/pipermail/uclibc/attachments/20070216/bf555834/attachment-0001.htm
More information about the uClibc
mailing list