Put fish on a diet. Tracked down the biggest memory hogs and fixed them. Total allocations down by a factor of 3 or so, live allocations a few KB.

This commit is contained in:
ridiculousfish
2012-03-03 15:20:30 -08:00
parent 8c0803e3c5
commit 3ead99b088
13 changed files with 177 additions and 104 deletions

View File

@@ -171,10 +171,17 @@ static void test_format(void) {
for (int j=-129; j <= 129; j++) {
char buff1[128], buff2[128];
format_int_safe(buff1, j);
format_long_safe(buff1, j);
sprintf(buff2, "%d", j);
assert( ! strcmp(buff1, buff2));
}
}
long q = LONG_MIN;
char buff1[128], buff2[128];
format_long_safe(buff1, q);
sprintf(buff2, "%ld", q);
assert( ! strcmp(buff1, buff2));
}
/**