Files
sing-box/service/oomkiller/service_stub.go
2026-04-10 16:24:25 +08:00

25 lines
504 B
Go

//go:build !darwin || !cgo
package oomkiller
import (
"github.com/sagernet/sing-box/adapter"
E "github.com/sagernet/sing/common/exceptions"
)
func (s *Service) Start(stage adapter.StartStage) error {
if stage != adapter.StartStateStart {
return nil
}
if !s.timerConfig.policyMode.hasTimerMode() {
return E.New("memory pressure monitoring is not available on this platform without memory_limit")
}
s.startTimer()
return nil
}
func (s *Service) Close() error {
s.stopTimer()
return nil
}