(numBranches int, numSamples int)
| 164 | } |
| 165 | |
| 166 | func newBranchPredictor(numBranches int, numSamples int) branchOptimizer { |
| 167 | return branchOptimizer{ |
| 168 | totals: make([]time.Duration, numBranches), |
| 169 | last: make([]time.Duration, numBranches), |
| 170 | samplesRemaining: numSamples, |
| 171 | Recording: true, |
| 172 | } |
| 173 | } |
| 174 | |
| 175 | // Start recording. Should be called immediately prior to a branch execution. |
| 176 | func (b *branchOptimizer) Start() { |
no outgoing calls
no test coverage detected