diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2012-03-03 15:20:30 -0800 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2012-03-03 15:22:03 -0800 |
commit | 3ead99b0883c49d465a90a6746409003d7224190 (patch) | |
tree | fad0ab467226584b975328b305fded21b980239e /fish_tests.cpp | |
parent | 8c0803e3c5d9cb874f5dd69ee2727eb4be99bfac (diff) |
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.
Diffstat (limited to 'fish_tests.cpp')
-rw-r--r-- | fish_tests.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/fish_tests.cpp b/fish_tests.cpp index c52c7cac..1cc986d5 100644 --- a/fish_tests.cpp +++ b/fish_tests.cpp @@ -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)); + } /** |