func (a *slabArena) Alloc(size int) unsafe.Pointer {
for i := 0; i < len(a.slabs); i++ {
ptr, ok := a.slabs[0].alloc(size)
shouldn't it read:
func (a *slabArena) Alloc(size int) unsafe.Pointer {
for i := 0; i < len(a.slabs); i++ {
ptr, ok := a.slabs[i].alloc(size) // !!!
instead ?
ie:
func (a *slabArena) Alloc(size int) unsafe.Pointer {
for i := 0; i < len(a.slabs); i++ {
- ptr, ok := a.slabs[0].alloc(size)
+ ptr, ok := a.slabs[i].alloc(size)
it seems to me this is fishy:
https://github.com/ortuman/nuke/blob/e765a1e99d3cc1afee1dd7c21110c0e77bfd3dee/slab_arena.go#L87..L88
shouldn't it read:
instead ?
ie: