mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-13 23:43:40 +00:00
internal/gclayout: make gclayout values constants
The previous versions calculated at init() prevented `interp` from running in many cases, increasing compile times due to the increased need to revert the partially interpreted results and also increasing binary runtime because fewer optimizations had happened during interp.
This commit is contained in:
@@ -51,7 +51,7 @@ func sliceGrow(oldBuf unsafe.Pointer, oldLen, oldCap, newCap, elemSize uintptr)
|
||||
var layout unsafe.Pointer
|
||||
// less type info here; can only go off element size
|
||||
if elemSize < unsafe.Sizeof(uintptr(0)) {
|
||||
layout = gclayout.NoPtrs
|
||||
layout = gclayout.NoPtrs.AsPtr()
|
||||
}
|
||||
|
||||
buf := alloc(newCap*elemSize, layout)
|
||||
|
||||
Reference in New Issue
Block a user