mirror of
https://github.com/SagerNet/sing-box.git
synced 2026-04-14 12:48:28 +10:00
25 lines
504 B
Go
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
|
|
}
|