File: align.go

package info (click to toggle)
golang-github-cilium-ebpf 0.11.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,776 kB
  • sloc: ansic: 1,046; makefile: 103; sh: 100
file content (8 lines) | stat: -rw-r--r-- 219 bytes parent folder | download
1
2
3
4
5
6
7
8
package internal

import "golang.org/x/exp/constraints"

// Align returns 'n' updated to 'alignment' boundary.
func Align[I constraints.Integer](n, alignment I) I {
	return (n + alignment - 1) / alignment * alignment
}