Esempio n. 1
0
 public CompositeList(Message msg, StructPointer tag)
 {
     _elementCount = tag.WordOffset;
     _dataWords    = tag.DataWords;
     _pointerWords = tag.PointerWords;
     msg.Allocate(_elementCount * (_dataWords + _pointerWords) + 1, out _tagOffset, out _segment);
     _segment[_tagOffset | Word.unit] = tag.RawValue;
 }
Esempio n. 2
0
 public bool Is(out StructPointer structPtr)
 {
     if (this.Type == PointerType.Struct)
     {
         structPtr = (StructPointer)this;
         return(true);
     }
     else
     {
         structPtr = default;
         return(false);
     }
 }
Esempio n. 3
0
        public CompositeList(Message msg, int count, out AllocationContext allocContext)
        {
            var tag = new StructPointer
            {
                Type         = PointerType.Struct,
                WordOffset   = 0,
                DataWords    = ReflectionCache <T> .KnownDataWords,
                PointerWords = ReflectionCache <T> .KnownPointerWords,
            };

            _elementCount = 0;
            _dataWords    = tag.DataWords;
            _pointerWords = tag.PointerWords;
            var elementWords = count * (_dataWords + _pointerWords);

            msg.Allocate(elementWords + 1, out _tagOffset, out _segment);
            allocContext = new AllocationContext(_segment, _tagOffset + 1, elementWords);
            _segment[_tagOffset | Word.unit] = tag.RawValue;
        }