Ejemplo n.º 1
0
        private unsafe Span <char> AcquireSpan(ref SafeBuffer?bufferToRelease)
        {
            SafeBuffer buffer = _buffer !;

            bool ignore = false;

            buffer.DangerousAddRef(ref ignore);

            bufferToRelease = buffer;

            return(new Span <char>((byte *)buffer.DangerousGetHandle(), (int)(buffer.ByteLength / 2)));
        }
Ejemplo n.º 2
0
        public override void Retain()
        {
            bool success = false;

            _buffer.DangerousAddRef(ref success);
        }