1 // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved.
2 // Use of this source code is governed by a MIT license found in the LICENSE file.
10 const fastpathEnabled = false
12 // The generated fast-path code is very large, and adds a few seconds to the build time.
13 // This causes test execution, execution of small tools which use codec, etc
14 // to take a long time.
16 // To mitigate, we now support the notfastpath tag.
17 // This tag disables fastpath during build, allowing for faster build, test execution,
18 // short-program runs, etc.
20 func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool { return false }
21 func fastpathEncodeTypeSwitch(iv interface{}, e *Encoder) bool { return false }
22 func fastpathEncodeTypeSwitchSlice(iv interface{}, e *Encoder) bool { return false }
23 func fastpathEncodeTypeSwitchMap(iv interface{}, e *Encoder) bool { return false }
24 func fastpathDecodeSetZeroTypeSwitch(iv interface{}) bool { return false }
26 type fastpathT struct{}
27 type fastpathE struct {
30 encfn func(*Encoder, *codecFnInfo, reflect.Value)
31 decfn func(*Decoder, *codecFnInfo, reflect.Value)
33 type fastpathA [0]fastpathE
35 func (x fastpathA) index(rtid uintptr) int { return -1 }
37 func (_ fastpathT) DecSliceUint8V(v []uint8, canChange bool, d *Decoder) (_ []uint8, changed bool) {
38 fn := d.cfer().get(uint8SliceTyp, true, true)
39 d.kSlice(&fn.i, reflect.ValueOf(&v).Elem())
43 var fastpathAV fastpathA
44 var fastpathTV fastpathT
47 type TestMammoth2Wrapper struct{} // to allow testMammoth work in notfastpath mode