optimize: lower the requirement of bootstrap memory

This commit is contained in:
mzz2017
2023-03-14 13:54:43 +08:00
parent b5846c410f
commit a6c2a077db
5 changed files with 34 additions and 10 deletions

View File

@ -97,10 +97,24 @@ func (i OutboundIndex) IsReserved() bool {
return !strings.HasPrefix(i.String(), "<index: ")
}
const (
MaxMatchSetLen = 32 * 3
var (
MaxMatchSetLen_ = ""
MaxMatchSetLen = 32 * 2
)
func init() {
if MaxMatchSetLen_ != "" {
i, err := strconv.Atoi(MaxMatchSetLen_)
if err != nil {
panic(err)
}
MaxMatchSetLen = i
}
if MaxMatchSetLen%32 != 0 {
panic("MaxMatchSetLen should be a multiple of 32: " + strconv.Itoa(MaxMatchSetLen))
}
}
type L4ProtoType uint8
const (