| 191 | } |
| 192 | |
| 193 | func newDynamicBlock(slotExprs []interpreter.InterpretableV2, expr interpreter.InterpretableV2) interpreter.InterpretableV2 { |
| 194 | bs := &dynamicBlock{ |
| 195 | slotExprs: slotExprs, |
| 196 | expr: expr, |
| 197 | } |
| 198 | bs.slotActivationPool = &sync.Pool{ |
| 199 | New: func() any { |
| 200 | slotCount := len(slotExprs) |
| 201 | sa := &dynamicSlotActivation{ |
| 202 | slotExprs: slotExprs, |
| 203 | slotCount: slotCount, |
| 204 | slotVals: make([]*slotVal, slotCount), |
| 205 | } |
| 206 | for i := 0; i < slotCount; i++ { |
| 207 | sa.slotVals[i] = &slotVal{} |
| 208 | } |
| 209 | return sa |
| 210 | }, |
| 211 | } |
| 212 | return bs |
| 213 | } |
| 214 | |
| 215 | type dynamicBlock struct { |
| 216 | slotExprs []interpreter.InterpretableV2 |