MCPcopy Create free account
hub / github.com/cel-expr/cel-go / Close

Method Close

interpreter/frame.go:117–151  ·  view source on GitHub ↗

Close releases the resources held by the execution frame and returns it to the pool.

()

Source from the content-addressed store, hash-verified

115
116// Close releases the resources held by the execution frame and returns it to the pool.
117func (f *ExecutionFrame) Close() {
118 if f.parent == nil && f.ctx != nil {
119 if f.ctx.cancel != nil {
120 f.ctx.cancel()
121 f.ctx.cancel = nil
122 }
123 f.ctx.ctx = nil
124 f.ctx.gate = nil
125 asyncCallStateTrackerPool.release(f.ctx.asyncCalls)
126 f.ctx.asyncCalls = nil
127 f.ctx.observer = nil
128 f.ctx.interrupt = nil
129 f.ctx.state = nil
130 f.ctx.costs = nil
131 f.ctx.interrupted.Store(false)
132 f.ctx.interruptCheckCount.Store(0)
133 f.ctx.interruptCheckFrequency = 0
134 evalContextPool.Put(f.ctx)
135 }
136 f.ctx = nil
137 f.parent = nil
138 if f.Activation != nil {
139 switch a := f.Activation.(type) {
140 case *hierarchicalActivation:
141 if child, ok := a.child.(*inputActivation); ok {
142 activationInput.release(child)
143 }
144 activationStack.release(a)
145 case *inputActivation:
146 activationInput.release(a)
147 }
148 f.Activation = nil
149 frameStack.Put(f)
150 }
151}
152
153// Push pushes the given activation onto the activation stack and returns the new frame.
154//

Callers 15

EvalMethod · 0.95
TestFolderActivationFunction · 0.80
TestV2AdapterFunction · 0.80
TestFindFrameFunction · 0.80
TestFrameCheckInterruptFunction · 0.80
TestFrameResolveNameFunction · 0.80

Calls 1

releaseMethod · 0.45