freemyipod r248 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r247‎ | r248 | r249 >
Date:23:48, 2 November 2010
Author:theseven
Status:new
Tags:
Comment:
libc: Optimize for performance instead of code size. Uses ~600 bytes more but is several times faster.
Modified paths:
  • /embios/trunk/libc/memchr.c (modified) (history)
  • /embios/trunk/libc/memcmp.c (modified) (history)
  • /embios/trunk/libc/memcpy.c (modified) (history)
  • /embios/trunk/libc/memmove.c (modified) (history)
  • /embios/trunk/libc/memset.c (modified) (history)
  • /embios/trunk/libc/strchr.c (modified) (history)
  • /embios/trunk/libc/strcmp.c (modified) (history)
  • /embios/trunk/libc/strcpy.c (modified) (history)
  • /embios/trunk/libc/strlen.c (modified) (history)
  • /embios/trunk/libc/strncmp.c (modified) (history)
  • /umsboot/libc/memcpy.c (modified) (history)
  • /umsboot/libc/memset.c (modified) (history)

Diff [purge]

Index: umsboot/libc/memcpy.c
@@ -61,7 +61,7 @@
6262 _CONST _PTR src0 _AND
6363 size_t len0)
6464 {
65 -#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__)
 65+#if defined(PREFER_SIZE_OVER_SPEED)
6666 char *dst = (char *) dst0;
6767 char *src = (char *) src0;
6868
Index: umsboot/libc/memset.c
@@ -47,7 +47,7 @@
4848 int c _AND
4949 size_t n)
5050 {
51 -#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__)
 51+#if defined(PREFER_SIZE_OVER_SPEED)
5252 char *s = (char *) m;
5353
5454 while (n-- != 0)
Index: embios/trunk/libc/memmove.c
@@ -64,7 +64,7 @@
6565 _CONST _PTR src_void _AND
6666 size_t length)
6767 {
68 -#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__)
 68+#if defined(PREFER_SIZE_OVER_SPEED)
6969 char *dst = dst_void;
7070 _CONST char *src = src_void;
7171
Index: embios/trunk/libc/strchr.c
@@ -64,7 +64,7 @@
6565 int i)
6666 {
6767 _CONST unsigned char *s = (_CONST unsigned char *)s1;
68 -#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__)
 68+#if defined(PREFER_SIZE_OVER_SPEED)
6969 unsigned char c = (unsigned int)i;
7070
7171 while (*s && *s != c)
Index: embios/trunk/libc/strlen.c
@@ -62,7 +62,7 @@
6363 _DEFUN (strlen, (str),
6464 _CONST char *str)
6565 {
66 -#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__)
 66+#if defined(PREFER_SIZE_OVER_SPEED)
6767 _CONST char *start = str;
6868
6969 while (*str)
Index: embios/trunk/libc/strcmp.c
@@ -63,7 +63,7 @@
6464 _CONST char *s1 _AND
6565 _CONST char *s2)
6666 {
67 -#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__)
 67+#if defined(PREFER_SIZE_OVER_SPEED)
6868 while (*s1 != '\0' && *s1 == *s2)
6969 {
7070 s1++;
Index: embios/trunk/libc/memchr.c
@@ -64,7 +64,7 @@
6565 int i _AND size_t n)
6666 {
6767 _CONST unsigned char *s = (_CONST unsigned char *)s1;
68 -#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__)
 68+#if defined(PREFER_SIZE_OVER_SPEED)
6969 unsigned char c = (unsigned char)i;
7070
7171 while (n-- > 0)
Index: embios/trunk/libc/memcmp.c
@@ -56,7 +56,7 @@
5757 _CONST _PTR m2 _AND
5858 size_t n)
5959 {
60 -#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__)
 60+#if defined(PREFER_SIZE_OVER_SPEED)
6161 unsigned char *s1 = (unsigned char *) m1;
6262 unsigned char *s2 = (unsigned char *) m2;
6363
Index: embios/trunk/libc/strcpy.c
@@ -63,7 +63,7 @@
6464 char *dst0 _AND
6565 _CONST char *src0)
6666 {
67 -#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__)
 67+#if defined(PREFER_SIZE_OVER_SPEED)
6868 char *s = dst0;
6969
7070 while ((*dst0++ = *src0++))
Index: embios/trunk/libc/strncmp.c
@@ -65,7 +65,7 @@
6666 _CONST char *s2 _AND
6767 size_t n)
6868 {
69 -#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__)
 69+#if defined(PREFER_SIZE_OVER_SPEED)
7070 if (n == 0)
7171 return 0;
7272
Index: embios/trunk/libc/memset.c
@@ -47,7 +47,7 @@
4848 int c _AND
4949 size_t n)
5050 {
51 -#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__)
 51+#if defined(PREFER_SIZE_OVER_SPEED)
5252 char *s = (char *) m;
5353
5454 while (n-- != 0)
Index: embios/trunk/libc/memcpy.c
@@ -61,7 +61,7 @@
6262 _CONST _PTR src0 _AND
6363 size_t len0)
6464 {
65 -#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__)
 65+#if defined(PREFER_SIZE_OVER_SPEED)
6666 char *dst = (char *) dst0;
6767 char *src = (char *) src0;
6868