]> git.saurik.com Git - wxWidgets.git/commitdiff
extra memory amount allocated for string data reduced to the paragraph multiple:
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 8 Aug 1998 21:39:43 +0000 (21:39 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 8 Aug 1998 21:39:43 +0000 (21:39 +0000)
so, in principle, it shouldn't waste any memory at all now (unless someone finds
a malloc implementation which is capable of allocation less than 16 bytes)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@479 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/string.cpp

index e52392bf89a455ecce0624e91fa5b2f50956f456..1273610fb6c6b7b54f5196c620168225254a5825 100644 (file)
@@ -47,7 +47,8 @@
 
 // allocating extra space for each string consumes more memory but speeds up
 // the concatenation operations (nLen is the current string's length)
-#define EXTRA_ALLOC       16
+// NB: EXTRA_ALLOC must be >= 0!
+#define EXTRA_ALLOC       (19 - nLen % 16)
 
 // ---------------------------------------------------------------------------
 // static class variables definition