From 330107a3e1f343acbfa4ffadcb3be4baa059cc76 Mon Sep 17 00:00:00 2001 From: "scc%mozilla.org" Date: Mon, 12 Jun 2000 02:54:22 +0000 Subject: [PATCH] reduce bloat by not chunk-allocating strings (in |nsStr::Alloc|). Clients that don't benefit from this can explicitly call |SetCapacity|. We may re-introduce this functionality in the append of a single character when no space remains, if it turns out to be a problem. This optimization was suggested by profiling done by sfraser, who now promises to find out where it hurts us. git-svn-id: svn://10.0.0.236/trunk@72019 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/string/obsolete/nsStr.cpp | 5 +++++ mozilla/xpcom/ds/nsStr.cpp | 5 +++++ mozilla/xpcom/string/obsolete/nsStr.cpp | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/mozilla/string/obsolete/nsStr.cpp b/mozilla/string/obsolete/nsStr.cpp index 823aa3e95a2..3ed68c4a67b 100644 --- a/mozilla/string/obsolete/nsStr.cpp +++ b/mozilla/string/obsolete/nsStr.cpp @@ -656,6 +656,7 @@ PRBool nsStr::Alloc(nsStr& aDest,PRUint32 aCount) { static int mAllocCount=0; mAllocCount++; +#ifdef NS_USE_CHUNKY_STRING_ALLOCATION //we're given the acount value in charunits; now scale up to next multiple. PRUint32 theNewCapacity=kDefaultStringSize; while(theNewCapacity