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
+2 -2
View File
@@ -4,9 +4,9 @@
- [x] Stack - [x] Stack
- [x] Queue - [x] Queue
- [x] Linked List - [x] Double Linked List
- [x] Circular Buffer - [x] Circular Buffer
- [ ] Deque - [ ] Deque (segmented array), ⛔ Not possible in Go
## Tree — hierarchical, parent/child relationships ## Tree — hierarchical, parent/child relationships
+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)
}