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).
Этот коммит содержится в:
Ayke van Laethem 2020-03-27 20:27:42 +01:00 коммит произвёл Ron Evans
родитель 67c242173c
коммит c01f81144e
3 изменённых файлов: 3 добавлений и 0 удалений

Просмотреть файл

@ -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)