From: Vadim Zeitlin Date: Sat, 8 Aug 1998 21:39:43 +0000 (+0000) Subject: extra memory amount allocated for string data reduced to the paragraph multiple: X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/77ca46e7e30eb2a553120c1edfc7aee84f2a6b9a extra memory amount allocated for string data reduced to the paragraph multiple: 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 --- diff --git a/src/common/string.cpp b/src/common/string.cpp index e52392bf89..1273610fb6 100644 --- a/src/common/string.cpp +++ b/src/common/string.cpp @@ -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