Files
judge/runner/limiter_other.go
2026-04-10 18:45:40 +03:00

28 lines
595 B
Go

//go:build !linux && !windows
package runner
import (
"fmt"
"os/exec"
)
type noopLimiter struct {
memLimit int64
}
func newLimiter(memLimit int64) limiter {
return &noopLimiter{memLimit: memLimit}
}
func (l *noopLimiter) prepare(cmd *exec.Cmd) error {
if l.memLimit > 0 {
return fmt.Errorf("memory_limit is not supported on this platform (only linux/windows)")
}
return nil
}
func (l *noopLimiter) afterStart(cmd *exec.Cmd) error { return nil }
func (l *noopLimiter) collect() limitStats { return limitStats{} }
func (l *noopLimiter) cleanup() {}