summaryrefslogtreecommitdiff
path: root/src/vm/appdomain.cpp
diff options
context:
space:
mode:
authorJan Kotas <jkotas@microsoft.com>2018-05-04 10:40:28 -0700
committerGitHub <noreply@github.com>2018-05-04 10:40:28 -0700
commit37e643696f860094ca3182c87f1375540b9d704e (patch)
tree5a840c7743873ca6c46e64a89487989a95880887 /src/vm/appdomain.cpp
parentfac17ce1413c2d270eb52e958faf5e869bcd33a2 (diff)
downloadcoreclr-37e643696f860094ca3182c87f1375540b9d704e.tar.gz
coreclr-37e643696f860094ca3182c87f1375540b9d704e.tar.bz2
coreclr-37e643696f860094ca3182c87f1375540b9d704e.zip
Fix System.String over-allocation (#17876)
BaseSize for System.String was not set correctly. It caused unnecessary extra 8 bytes to be allocated at the end of strings that had `Length % 4 < 2` on 64-bit platforms. This change makes affected strings proportionally cheaper. For example, `new string('a', 1)` in a long-running loop is 7% faster.
Diffstat (limited to 'src/vm/appdomain.cpp')
-rw-r--r--src/vm/appdomain.cpp2
1 files changed, 0 insertions, 2 deletions
diff --git a/src/vm/appdomain.cpp b/src/vm/appdomain.cpp
index 67b79ec19d..292ac13d71 100644
--- a/src/vm/appdomain.cpp
+++ b/src/vm/appdomain.cpp
@@ -2759,8 +2759,6 @@ void SystemDomain::LoadBaseSystemClasses()
// Load String
g_pStringClass = MscorlibBinder::LoadPrimitiveType(ELEMENT_TYPE_STRING);
- _ASSERTE(g_pStringClass->GetBaseSize() == ObjSizeOf(StringObject)+sizeof(WCHAR));
- _ASSERTE(g_pStringClass->GetComponentSize() == 2);
// Used by Buffer::BlockCopy
g_pByteArrayMT = ClassLoader::LoadArrayTypeThrowing(