Ejemplo n.º 1
0
        public MyIterator TestMethod()
        {
            lock (_returnLock)
            {
                if (_tail == null)
                {
                    return(default(MyIterator));
                }

                // In this assignment there could be a GC hole:
                // gcrReg -[rbx]
                // byrReg +[rbx]
                // add    rbx, 32
                // mov    r15, rbx <--- r15 is not tracked to have a byref pointer.
                // If a GC happens between this instruction and the next one, we have an invalid pointer.
                // gcrReg -[rdi]
                // byrReg +[rdi]
                // mov    rdi, r15
                // New gcrReg live regs = 00000000 { }

                _lastStart = new MyIterator(_tail, _tail.End);
                return(_lastStart);
            }
        }
Ejemplo n.º 2
0
        public MyIterator TestMethod()
        {
            lock (_returnLock) 
            {
                if (_tail == null) 
                { 
                    return default(MyIterator); 
                }

                // In this assignment there could be a GC hole:
                // gcrReg -[rbx]
                // byrReg +[rbx]
                // add    rbx, 32
                // mov    r15, rbx <--- r15 is not tracked to have a byref pointer.
                // If a GC happens between this instruction and the next one, we have an invalid pointer.
                // gcrReg -[rdi]
                // byrReg +[rdi]
                // mov    rdi, r15
                // New gcrReg live regs = 00000000 { }

                _lastStart = new MyIterator(_tail, _tail.End);
                return _lastStart; 
            } 
        }