mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-20 12:29:03 +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:
@@ -89,7 +89,7 @@ func alloc(size uintptr, layout unsafe.Pointer) unsafe.Pointer {
|
||||
gcLock.Lock()
|
||||
needsResumeWorld = false
|
||||
var ptr unsafe.Pointer
|
||||
if layout == gclayout.NoPtrs {
|
||||
if layout == gclayout.NoPtrs.AsPtr() {
|
||||
// This object is entirely pointer free, for example make([]int, ...).
|
||||
// Make sure the GC knows this so it doesn't scan the object
|
||||
// unnecessarily to improve performance.
|
||||
|
||||
Reference in New Issue
Block a user