Reduced number of packages

This commit is contained in:
2024-08-26 15:34:34 +02:00
parent b225717775
commit e2a6a31d8e
12 changed files with 36 additions and 69 deletions

7
src/fs/Align.go Normal file
View File

@ -0,0 +1,7 @@
package fs
// Align calculates the next aligned address and the padding needed.
func Align[T int | uint | int64 | uint64 | int32 | uint32](n T, alignment T) (T, T) {
aligned := (n + (alignment - 1)) & ^(alignment - 1)
return aligned, aligned - n
}