mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-03 02:27:48 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3e5f602655 |
@@ -14,6 +14,9 @@ import (
|
|||||||
// Ever-incrementing pointer: no memory is freed.
|
// Ever-incrementing pointer: no memory is freed.
|
||||||
var heapptr = heapStart
|
var heapptr = heapStart
|
||||||
|
|
||||||
|
// Inlining alloc() speeds things up slightly but bloats the executable by 50%,
|
||||||
|
// see https://github.com/tinygo-org/tinygo/issues/2674. So don't.
|
||||||
|
//go:noinline
|
||||||
func alloc(size uintptr, layout unsafe.Pointer) unsafe.Pointer {
|
func alloc(size uintptr, layout unsafe.Pointer) unsafe.Pointer {
|
||||||
// TODO: this can be optimized by not casting between pointers and ints so
|
// TODO: this can be optimized by not casting between pointers and ints so
|
||||||
// much. And by using platform-native data types (e.g. *uint8 for 8-bit
|
// much. And by using platform-native data types (e.g. *uint8 for 8-bit
|
||||||
|
|||||||
Reference in New Issue
Block a user