prog: move MaxPids const to prog

The const may be needed by other packages.
E.g. when checking manager config.
This commit is contained in:
Dmitry Vyukov 2018-07-25 10:38:58 +02:00
parent 3cbc0ac516
commit e0c1bcbabc
2 changed files with 4 additions and 3 deletions

View File

@ -371,12 +371,11 @@ var typeProc = &typeDesc{
if size == 64 {
max = ^uint64(0)
}
const maxPids = 32 // executor knows about this constant (MAX_PIDS)
if start >= max {
comp.error(args[0].Pos, "values starting from %v overflow base type", start)
} else if perProc > (max-start)/maxPids {
} else if perProc > (max-start)/prog.MaxPids {
comp.error(args[0].Pos, "values starting from %v with step %v overflow base type for %v procs",
start, perProc, maxPids)
start, perProc, prog.MaxPids)
}
},
Gen: func(comp *compiler, t *ast.Type, args []*ast.Type, base prog.IntTypeCommon) prog.Type {

View File

@ -235,6 +235,8 @@ type ProcType struct {
ValuesPerProc uint64
}
const MaxPids = 32
func (t *ProcType) Default() uint64 {
// Special value denoting 0 for all procs.
return 0xffffffffffffffff