@@ -3,29 +3,31 @@ package configs
33import "golang.org/x/sys/unix"
44
55// Memory policy modes and flags as defined in /usr/include/linux/mempolicy.h
6-
6+ //
7+ // Deprecated: use constants from [unix] instead.
8+ //
79//nolint:revive,staticcheck,nolintlint // ignore ALL_CAPS errors in consts from numaif.h, will match unix.* in the future
810const (
9- MPOL_DEFAULT = 0
10- MPOL_PREFERRED = 1
11- MPOL_BIND = 2
12- MPOL_INTERLEAVE = 3
13- MPOL_LOCAL = 4
14- MPOL_PREFERRED_MANY = 5
15- MPOL_WEIGHTED_INTERLEAVE = 6
11+ MPOL_DEFAULT = unix . MPOL_DEFAULT
12+ MPOL_PREFERRED = unix . MPOL_PREFERRED
13+ MPOL_BIND = unix . MPOL_BIND
14+ MPOL_INTERLEAVE = unix . MPOL_INTERLEAVE
15+ MPOL_LOCAL = unix . MPOL_LOCAL
16+ MPOL_PREFERRED_MANY = unix . MPOL_PREFERRED_MANY
17+ MPOL_WEIGHTED_INTERLEAVE = unix . MPOL_WEIGHTED_INTERLEAVE
1618
17- MPOL_F_STATIC_NODES = 1 << 15
18- MPOL_F_RELATIVE_NODES = 1 << 14
19- MPOL_F_NUMA_BALANCING = 1 << 13
19+ MPOL_F_STATIC_NODES = unix . MPOL_F_STATIC_NODES
20+ MPOL_F_RELATIVE_NODES = unix . MPOL_F_RELATIVE_NODES
21+ MPOL_F_NUMA_BALANCING = unix . MPOL_F_NUMA_BALANCING
2022)
2123
2224// LinuxMemoryPolicy contains memory policy configuration.
2325type LinuxMemoryPolicy struct {
2426 // Mode specifies memory policy mode without mode flags. See
2527 // set_mempolicy() documentation for details.
26- Mode uint `json:"mode,omitempty"`
28+ Mode int `json:"mode,omitempty"`
2729 // Flags contains mode flags.
28- Flags uint `json:"flags,omitempty"`
30+ Flags int `json:"flags,omitempty"`
2931 // Nodes contains NUMA nodes to which the mode applies.
3032 Nodes * unix.CPUSet `json:"nodes,omitempty"`
3133}
0 commit comments