Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corert.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYi Zhang (CLR) <yizhang82@users.noreply.github.com>2017-05-21 07:02:40 +0300
committerGitHub <noreply@github.com>2017-05-21 07:02:40 +0300
commit8eb9ffe39300ca9647546580d1ee071a0c8de34d (patch)
tree319f1eb3e566808b85d3f5b9463b3d544681bfb8 /src/System.Private.CoreLib
parent422c171ff9a8e38c3e349d17c2e1344042258ff1 (diff)
Initial support for preinitialized array in CoreRT (#3558)
* Add PreInitFieldInfo that extracts preinitialized data information from fields that have [PreInitialized] and [InitDataBlob] pointing to RVA field * Added FrozenArrayNode for frozen arrays with data extracted from preinit RVA data field * Added GCStaticsPreInitDataNode (CoreRT only) to hold GC pointers for GC static fields. Pre-init data fields points to frozen data, while other data initialized to null. * Changed GCStaticsNode to emit a pointer reloc to GCStaticspreInitDataNode and mask 0x2 for the GC static EEType. * Changed InitializedStatics in StartupCodeHelper to check for 0x2 and memcpy the GC field data as needed * Fixed a bug in bad GCStaticsEETypeNode size calculation - it's off-by-1 as static GC static field layout in CoreRT includes EEType already.
Diffstat (limited to 'src/System.Private.CoreLib')
-rw-r--r--src/System.Private.CoreLib/src/System/Object.cs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/System.Private.CoreLib/src/System/Object.cs b/src/System.Private.CoreLib/src/System/Object.cs
index 22dc37a1b..7207d24f6 100644
--- a/src/System.Private.CoreLib/src/System/Object.cs
+++ b/src/System.Private.CoreLib/src/System/Object.cs
@@ -22,6 +22,7 @@ using Internal.Reflection.Core.NonPortable;
#if INPLACE_RUNTIME
using EEType = Internal.Runtime.EEType;
+using ObjHeader = Internal.Runtime.ObjHeader;
#endif
namespace System
@@ -152,6 +153,15 @@ namespace System
{
return ref Unsafe.As<RawData>(this).Data;
}
+
+ /// <summary>
+ /// Return size of all data (excluding ObjHeader and EEType*).
+ /// Note that for strings/arrays this would include the Length as well.
+ /// </summary>
+ internal uint GetRawDataSize()
+ {
+ return EETypePtr.BaseSize - (uint)sizeof(ObjHeader) - (uint)sizeof(EEType*);
+ }
}
}