mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-15 16:33:40 +00:00
rp2040: fix -gc=leaking/none
This commit is contained in:
@@ -784,6 +784,8 @@ endif
|
|||||||
@$(MD5SUM) test.hex
|
@$(MD5SUM) test.hex
|
||||||
$(TINYGO) build -size short -o test.hex -target=pico examples/blinky1
|
$(TINYGO) build -size short -o test.hex -target=pico examples/blinky1
|
||||||
@$(MD5SUM) test.hex
|
@$(MD5SUM) test.hex
|
||||||
|
$(TINYGO) build -size short -o test.hex -target=pico -gc=leaking examples/blinky1
|
||||||
|
@$(MD5SUM) test.hex
|
||||||
$(TINYGO) build -size short -o test.hex -target=nano-33-ble examples/blinky1
|
$(TINYGO) build -size short -o test.hex -target=nano-33-ble examples/blinky1
|
||||||
@$(MD5SUM) test.hex
|
@$(MD5SUM) test.hex
|
||||||
$(TINYGO) build -size short -o test.hex -target=nano-rp2040 examples/blinky1
|
$(TINYGO) build -size short -o test.hex -target=nano-rp2040 examples/blinky1
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ func handleUSBSetAddress(setup usb.Setup) bool {
|
|||||||
const ackTimeout = 570
|
const ackTimeout = 570
|
||||||
|
|
||||||
rp.USBCTRL_REGS.SIE_STATUS.Set(rp.USBCTRL_REGS_SIE_STATUS_ACK_REC)
|
rp.USBCTRL_REGS.SIE_STATUS.Set(rp.USBCTRL_REGS_SIE_STATUS_ACK_REC)
|
||||||
sendUSBPacket(0, []byte{})
|
sendUSBPacket(0, nil)
|
||||||
|
|
||||||
// Wait for transfer to complete with a timeout.
|
// Wait for transfer to complete with a timeout.
|
||||||
t := timer.timeElapsed()
|
t := timer.timeElapsed()
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ func setEPDataPID(ep uint32, dataOne bool) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func SendZlp() {
|
func SendZlp() {
|
||||||
sendUSBPacket(0, []byte{})
|
sendUSBPacket(0, nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
func sendViaEPIn(ep uint32, data []byte, count int) {
|
func sendViaEPIn(ep uint32, data []byte, count int) {
|
||||||
|
|||||||
@@ -8,11 +8,16 @@ package runtime
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"internal/task"
|
"internal/task"
|
||||||
|
"sync/atomic"
|
||||||
"unsafe"
|
"unsafe"
|
||||||
)
|
)
|
||||||
|
|
||||||
const needsStaticHeap = true
|
const needsStaticHeap = true
|
||||||
|
|
||||||
|
var gcScanState atomic.Uint32
|
||||||
|
|
||||||
|
func scanCurrentStack() {}
|
||||||
|
|
||||||
// Ever-incrementing pointer: no memory is freed.
|
// Ever-incrementing pointer: no memory is freed.
|
||||||
var heapptr uintptr
|
var heapptr uintptr
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ package runtime
|
|||||||
// targets that have far too little RAM even for the leaking memory allocator.
|
// targets that have far too little RAM even for the leaking memory allocator.
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"sync/atomic"
|
||||||
"unsafe"
|
"unsafe"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -15,6 +16,9 @@ const needsStaticHeap = false
|
|||||||
var gcTotalAlloc uint64 // for runtime.MemStats
|
var gcTotalAlloc uint64 // for runtime.MemStats
|
||||||
var gcMallocs uint64
|
var gcMallocs uint64
|
||||||
var gcFrees uint64
|
var gcFrees uint64
|
||||||
|
var gcScanState atomic.Uint32
|
||||||
|
|
||||||
|
func scanCurrentStack() {}
|
||||||
|
|
||||||
func alloc(size uintptr, layout unsafe.Pointer) unsafe.Pointer
|
func alloc(size uintptr, layout unsafe.Pointer) unsafe.Pointer
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user