DomainMatcher: Reduce runtime memory usage and startup peak memory on iOS (#5924)

https://github.com/XTLS/Xray-core/pull/5814#issuecomment-4231071433

Closes https://github.com/XTLS/Xray-core/issues/4422
This commit is contained in:
Meow
2026-04-14 00:54:43 +08:00
committed by GitHub
parent 82624bcaf0
commit 05a11910d4
2 changed files with 125 additions and 4 deletions
+7 -3
View File
@@ -1,13 +1,17 @@
package geodata
type DomainRegistry struct{}
type DomainRegistry struct {
factory DomainMatcherFactory
}
func (r *DomainRegistry) BuildDomainMatcher(rules []*DomainRule) (DomainMatcher, error) {
return buildDomainMatcher(rules)
return r.factory.BuildMatcher(rules)
}
func newDomainRegistry() *DomainRegistry {
return &DomainRegistry{}
return &DomainRegistry{
factory: newDomainMatcherFactory(),
}
}
var DomainReg = newDomainRegistry()