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; }
public bool Is(out StructPointer structPtr) { if (this.Type == PointerType.Struct) { structPtr = (StructPointer)this; return(true); } else { structPtr = default; return(false); } }
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; }