Example #1
0
 public ReadOnlySpan <byte> AsBytes()
 {
     return(SpanHelpers.AsByteSpan(ref this));
 }
Example #2
0
 /// <summary>
 /// Returns a view of the element at index <paramref name="elementIndex"/> as a <see cref="Span{T}"/> of bytes.
 /// </summary>
 /// <param name="elementIndex">The zero-based index of the element.</param>
 /// <returns>A byte span representation of the element.</returns>
 public Span <byte> GetByteSpan(int elementIndex)
 {
     return(SpanHelpers.AsByteSpan(ref _buffer[elementIndex]));
 }
Example #3
0
 public BlitStruct(ref T data)
 {
     _buffer = SpanHelpers.AsSpan(ref data);
 }
Example #4
0
        public static void ReleaseGuard(ref nint guard, object mutex)
        {
            SpanHelpers.AsByteSpan(ref guard)[0] = GuardBitComplete;

            ReleaseInitByte(ref Unsafe.As <byte, InitStatus>(ref SpanHelpers.AsByteSpan(ref guard)[1]), mutex);
        }