public PrimitiveList(Segment segment, int baseWordOffset, ListPointer listPointer) { TypeHelpers.AssertSize <T>(listPointer.ElementSize); this.Segment = segment; this.ListWordOffset = baseWordOffset + listPointer.WordOffset; this.Count = (int)listPointer.ElementCount; }
public bool Is(out ListPointer listPtr) { if (this.Type == PointerType.List) { listPtr = (ListPointer)this; return(true); } else { listPtr = default; return(false); } }
public CompositeList(Segment segment, int baseOffset, ListPointer listPointer) { if (listPointer.ElementSize != ElementSize.Composite) { throw new NotSupportedException("Element size not composite (upgraded struct lists not fully supported)"); } _segment = segment; _tagOffset = baseOffset + listPointer.WordOffset; var tag = Unsafe.As <ulong, StructPointer>(ref _segment[_tagOffset | Word.unit]); _elementCount = tag.WordOffset; _dataWords = tag.DataWords; _pointerWords = tag.PointerWords; }
public Text(Segment segment, int baseWordOffset, ListPointer listPointer) { TypeHelpers.AssertSize <byte>(listPointer.ElementSize); _bytes = new FlatArray <byte>(new AbsPointer(segment, baseWordOffset, listPointer)); }