Example #1
0
 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;
 }
Example #2
0
 public bool Is(out ListPointer listPtr)
 {
     if (this.Type == PointerType.List)
     {
         listPtr = (ListPointer)this;
         return(true);
     }
     else
     {
         listPtr = default;
         return(false);
     }
 }
Example #3
0
        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;
        }
Example #4
0
 public Text(Segment segment, int baseWordOffset, ListPointer listPointer)
 {
     TypeHelpers.AssertSize <byte>(listPointer.ElementSize);
     _bytes = new FlatArray <byte>(new AbsPointer(segment, baseWordOffset, listPointer));
 }