Ejemplo n.º 1
0
        /// <summary>
        /// Invoke the given action on a set of cached buffers.
        /// </summary>
        public static T TwoBufferInvoke <BufferType, T>(Func <BufferType, BufferType, T> func)
            where BufferType : HeapBuffer
        {
            var wrapper = new TwoBufferFuncWrapper <BufferType, T> {
                Func = func
            };

            TwoBufferInvoke <TwoBufferFuncWrapper <BufferType, T>, BufferType>(ref wrapper);
            return(wrapper.Result);
        }
Ejemplo n.º 2
0
        /// <summary>
        ///  Invoke the given action on a set of cached buffers.
        /// </summary>
        public static T TwoBufferInvoke <TBuffer, T>(Func <TBuffer, TBuffer, T> func)
            where TBuffer : HeapBuffer
        {
            var wrapper = new TwoBufferFuncWrapper <TBuffer, T> {
                Func = func
            };

            TwoBufferInvoke <TwoBufferFuncWrapper <TBuffer, T>, TBuffer>(ref wrapper);
            return(wrapper.Result);
        }