diff --git a/Source/GSString.m b/Source/GSString.m index a4bf3175e..d1afd8ac7 100644 --- a/Source/GSString.m +++ b/Source/GSString.m @@ -755,6 +755,11 @@ static BOOL useTinyStrings; @interface GSTinyString : NSString @end +static int tinyStrings = 0; +static void logTinyStringCount(void) +{ + fprintf(stderr, "%d tiny strings created\n", tinyStrings); +} @implementation GSTinyString - (NSUInteger) length { @@ -783,6 +788,7 @@ static BOOL useTinyStrings; + (void) load { useTinyStrings = objc_registerSmallObjectClass_np(self, TINY_STRING_MASK); + atexit(logTinyStringCount); } + (id) alloc @@ -854,8 +860,11 @@ createTinyString(const char *str, int length) s |= length << TINY_STRING_LENGTH_SHIFT; for (i = 0 ; i