simplify buffer.go implementation & load buf.size with atomic.LoadInt32