mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-06 20:13:40 +00:00
machine: avoid binary size regression after LLVM memory intrinsics
Somehow moving to LLVM memory intrinsics for calls like memcpy made the machine.sendUSBPacket get inlined. This is a problem because it is called in many different functions and it is just big enough to cause a significant file size increase. Adding //go:noinline solves this problem and gets the examples/blinky1 program below the file size it was before this change (tested: itsybitsy-m0, itsybitsy-m4, circuitplay-bluefruit).
This commit is contained in:
committed by
Ron Evans
parent
67c242173c
commit
c01f81144e
@@ -1736,6 +1736,7 @@ func cdcSetup(setup usbSetup) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
//go:noinline
|
||||
func sendUSBPacket(ep uint32, data []byte) {
|
||||
copy(udd_ep_in_cache_buffer[ep][:], data)
|
||||
|
||||
|
||||
@@ -1907,6 +1907,7 @@ func cdcSetup(setup usbSetup) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
//go:noinline
|
||||
func sendUSBPacket(ep uint32, data []byte) {
|
||||
copy(udd_ep_in_cache_buffer[ep][:], data)
|
||||
|
||||
|
||||
@@ -384,6 +384,7 @@ func cdcSetup(setup usbSetup) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
//go:noinline
|
||||
func sendUSBPacket(ep uint32, data []byte) {
|
||||
count := len(data)
|
||||
copy(udd_ep_in_cache_buffer[ep][:], data)
|
||||
|
||||
Reference in New Issue
Block a user