]> Cypherpunks.ru repositories - gostls13.git/blobdiff - src/runtime/string.go
runtime: implement experiment to replace heap bitmap with alloc headers
[gostls13.git] / src / runtime / string.go
index 7ac3e66a3ac80ce2e233353b2b435e8d61f678f0..e01b7fc74448e5c41ed9c146f70e1d86e42cef26 100644 (file)
@@ -270,7 +270,7 @@ func rawstring(size int) (s string, b []byte) {
 
 // rawbyteslice allocates a new byte slice. The byte slice is not zeroed.
 func rawbyteslice(size int) (b []byte) {
-       cap := roundupsize(uintptr(size))
+       cap := roundupsize(uintptr(size), true)
        p := mallocgc(cap, nil, false)
        if cap != uintptr(size) {
                memclrNoHeapPointers(add(p, uintptr(size)), cap-uintptr(size))
@@ -285,7 +285,7 @@ func rawruneslice(size int) (b []rune) {
        if uintptr(size) > maxAlloc/4 {
                throw("out of memory")
        }
-       mem := roundupsize(uintptr(size) * 4)
+       mem := roundupsize(uintptr(size)*4, true)
        p := mallocgc(mem, nil, false)
        if mem != uintptr(size)*4 {
                memclrNoHeapPointers(add(p, uintptr(size)*4), mem-uintptr(size)*4)