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

Method Close

interpreter/frame.go:104–132  ·  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

102
103// Close releases the resources held by the execution frame and returns it to the pool.
104func (f *ExecutionFrame) Close() {
105 if f.parent == nil && f.ctx != nil {
106 if f.ctx.cancel != nil {
107 f.ctx.cancel()
108 f.ctx.cancel = nil
109 }
110 f.ctx.ctx = nil
111 f.ctx.interrupt = nil
112 f.ctx.state = nil
113 f.ctx.costs = nil
114 f.ctx.interrupted.Store(false)
115 f.ctx.interruptCheckCount.Store(0)
116 f.ctx.interruptCheckFrequency = 0
117 evalContextPool.Put(f.ctx)
118 }
119 f.ctx = nil
120 f.parent = nil
121 switch a := f.Activation.(type) {
122 case *hierarchicalActivation:
123 if child, ok := a.child.(*inputActivation); ok {
124 activationInput.release(child)
125 }
126 activationStack.release(a)
127 case *inputActivation:
128 activationInput.release(a)
129 }
130 f.Activation = nil
131 frameStack.Put(f)
132}
133
134// Push pushes the given activation onto the activation stack and returns the new frame.
135//

Callers 15

EvalMethod · 0.95
TestFolderActivationFunction · 0.80
TestV2AdapterFunction · 0.80
TestFindFrameFunction · 0.80
TestFrameCheckInterruptFunction · 0.80
TestFrameResolveNameFunction · 0.80
TestFrameParentFunction · 0.80
TestFrameUnwrapFunction · 0.80
TestFramePushPopFunction · 0.80

Calls 1

releaseMethod · 0.45

Tested by 15

TestFolderActivationFunction · 0.64
TestV2AdapterFunction · 0.64
TestFindFrameFunction · 0.64
TestFrameCheckInterruptFunction · 0.64
TestFrameResolveNameFunction · 0.64
TestFrameParentFunction · 0.64
TestFrameUnwrapFunction · 0.64
TestFramePushPopFunction · 0.64
TestFrameCloseFunction · 0.64