(idx int)
| 829 | } |
| 830 | |
| 831 | func (ls *LState) closeUpvalues(idx int) { // +inline-start |
| 832 | if ls.uvcache != nil { |
| 833 | var prev *Upvalue |
| 834 | for uv := ls.uvcache; uv != nil; uv = uv.next { |
| 835 | if uv.index >= idx { |
| 836 | if prev != nil { |
| 837 | prev.next = nil |
| 838 | } else { |
| 839 | ls.uvcache = nil |
| 840 | } |
| 841 | uv.Close() |
| 842 | } |
| 843 | prev = uv |
| 844 | } |
| 845 | } |
| 846 | } // +inline-end |
| 847 | |
| 848 | func (ls *LState) findUpvalue(idx int) *Upvalue { |
| 849 | var prev *Upvalue |