This commit is contained in:
Acid
2026-05-09 17:56:46 -04:00
parent d2dcd223a6
commit 1434ccf52b
2 changed files with 14 additions and 2 deletions
+12
View File
@@ -0,0 +1,12 @@
package main
import (
"unsafe"
)
// GetChunkSize() -> returns the amount of elements for chunk or 1
// if size of T > 521, (unused)
// c++ 512 bytes implementation
func GetChunkSize[T any](val T) uintptr {
return max(512/unsafe.Sizeof(*new(T)), 1)
}