public void InitSecondaryItems(CachedSnapshot cs) { typeInfoToArrayIndex = Enumerable.Range(0, (int)typeInfoAddress.Length).ToDictionary(x => typeInfoAddress[x], x => x); typeIndexToArrayIndex = Enumerable.Range(0, (int)typeIndex.Length).ToDictionary(x => typeIndex[x], x => x); m_HasStaticFields = new bool[Count]; fieldIndices_instance = new int[Count][]; fieldIndices_static = new int[Count][]; fieldIndicesOwned_static = new int[Count][]; for (int i = 0; i < Count; ++i) { m_HasStaticFields[i] = false; foreach (var iField in fieldIndices[i]) { if (cs.fieldDescriptions.isStatic[iField]) { m_HasStaticFields[i] = true; break; } } fieldIndices_instance[i] = TypeTools.AllFieldArrayIndexOf(i, cs, TypeTools.FieldFindOptions.OnlyInstance, true).ToArray(); fieldIndices_static[i] = TypeTools.AllFieldArrayIndexOf(i, cs, TypeTools.FieldFindOptions.OnlyStatic, true).ToArray(); fieldIndicesOwned_static[i] = TypeTools.AllFieldArrayIndexOf(i, cs, TypeTools.FieldFindOptions.OnlyStatic, false).ToArray(); } iType_ValueType = typeDescriptionName.FindIndex(x => x == "System.ValueType"); iType_Object = typeDescriptionName.FindIndex(x => x == "System.Object"); iType_Enum = typeDescriptionName.FindIndex(x => x == "System.Enum"); }
public void InitSecondaryItems(CachedSnapshot cs) { typeInfoToArrayIndex = Enumerable.Range(0, (int)typeInfoAddress.Length).ToDictionary(x => typeInfoAddress[x], x => x); typeIndexToArrayIndex = Enumerable.Range(0, (int)typeIndex.Length).ToDictionary(x => typeIndex[x], x => x); using (typeFieldArraysBuild.Auto()) { m_HasStaticFields = new bool[Count]; fieldIndices_instance = new int[Count][]; fieldIndices_static = new int[Count][]; fieldIndicesOwned_static = new int[Count][]; List <int> fieldProcessingBuffer = new List <int>(k_DefaultFieldProcessingBufferSize); for (int i = 0; i < Count; ++i) { m_HasStaticFields[i] = false; foreach (var iField in fieldIndices[i]) { if (cs.fieldDescriptions.isStatic[iField]) { m_HasStaticFields[i] = true; break; } } TypeTools.AllFieldArrayIndexOf(ref fieldProcessingBuffer, i, cs, TypeTools.FieldFindOptions.OnlyInstance, true); fieldIndices_instance[i] = fieldProcessingBuffer.ToArray(); TypeTools.AllFieldArrayIndexOf(ref fieldProcessingBuffer, i, cs, TypeTools.FieldFindOptions.OnlyStatic, true); fieldIndices_static[i] = fieldProcessingBuffer.ToArray(); TypeTools.AllFieldArrayIndexOf(ref fieldProcessingBuffer, i, cs, TypeTools.FieldFindOptions.OnlyStatic, false); fieldIndicesOwned_static[i] = fieldProcessingBuffer.ToArray(); } } iType_ValueType = typeDescriptionName.FindIndex(x => x == k_SystemValueTypeName); iType_Object = typeDescriptionName.FindIndex(x => x == k_SystemObjectTypeName); iType_Enum = typeDescriptionName.FindIndex(x => x == k_SystemEnumTypeName); }