feat: fix typos
Этот коммит содержится в:
родитель
4b0e56cbec
коммит
d73e12db63
9 изменённых файлов: 34 добавлений и 34 удалений
|
@ -416,7 +416,7 @@
|
|||
- `interp`: always run atomic and volatile loads/stores at runtime
|
||||
- `interp`: bump timeout to 180 seconds
|
||||
- `interp`: handle type assertions on nil interfaces
|
||||
- `loader`: elminate goroot cache inconsistency
|
||||
- `loader`: eliminate goroot cache inconsistency
|
||||
- `loader`: respect $GOROOT when running `go list`
|
||||
- `transform`: allocate the correct amount of bytes in an alloca
|
||||
- `transform`: remove switched func lowering
|
||||
|
@ -1115,7 +1115,7 @@
|
|||
- `sync`: add WaitGroup
|
||||
* **targets**
|
||||
- `arm`: allow nesting in DisableInterrupts and EnableInterrupts
|
||||
- `arm`: make FPU configuraton consistent
|
||||
- `arm`: make FPU configuration consistent
|
||||
- `arm`: do not mask fault handlers in critical sections
|
||||
- `atmega2560`: fix pin mapping for pins D2, D5 and the L port
|
||||
- `atsamd`: return an error when an incorrect PWM pin is used
|
||||
|
@ -1144,7 +1144,7 @@
|
|||
- `nrf`: add microbit-s110v8 target
|
||||
- `nrf`: fix bug in SPI.Tx
|
||||
- `nrf`: support debugging the PCA10056
|
||||
- `pygamer`: add Adafruit PyGamer suport
|
||||
- `pygamer`: add Adafruit PyGamer support
|
||||
- `riscv`: fix interrupt configuration bug
|
||||
- `riscv`: disable linker relaxations during gp init
|
||||
- `stm32f4disco`: add new target with ST-Link v2.1 debugger
|
||||
|
|
|
@ -544,7 +544,7 @@ func (b *builder) createRunDefers() {
|
|||
forwardParams = append(forwardParams, forwardParam)
|
||||
}
|
||||
|
||||
// Plain TinyGo functions add some extra parameters to implement async functionality and function recievers.
|
||||
// Plain TinyGo functions add some extra parameters to implement async functionality and function receivers.
|
||||
// These parameters should not be supplied when calling into an external C/ASM function.
|
||||
if !b.getFunctionInfo(callback).exported {
|
||||
// Add the context parameter. We know it is ignored by the receiving
|
||||
|
|
|
@ -70,7 +70,7 @@ object. Every memory object is given an index, and pointers use that index to
|
|||
look up the current active object for the pointer to load from or to copy
|
||||
when storing to it.
|
||||
|
||||
Rolling back a function should roll back everyting, including the few
|
||||
Rolling back a function should roll back everything, including the few
|
||||
instructions emitted at runtime. This is done by treating instructions much
|
||||
like memory objects and removing the created instructions when necessary.
|
||||
|
||||
|
@ -88,7 +88,7 @@ LLVM than initialization code. Also, there are a few other benefits:
|
|||
they can be propagated and provide some opportunities for other
|
||||
optimizations (like dead code elimination when branching on the contents of
|
||||
a global).
|
||||
* Constants are much more efficent on microcontrollers, as they can be
|
||||
* Constants are much more efficient on microcontrollers, as they can be
|
||||
allocated in flash instead of RAM.
|
||||
|
||||
The Go SSA package does not create constant initializers for globals.
|
||||
|
|
|
@ -254,7 +254,7 @@ func (r *runner) compileFunction(llvmFn llvm.Value) *function {
|
|||
}
|
||||
}
|
||||
case llvm.BitCast, llvm.IntToPtr, llvm.PtrToInt:
|
||||
// Bitcasts are ususally used to cast a pointer from one type to
|
||||
// Bitcasts are usually used to cast a pointer from one type to
|
||||
// another leaving the pointer itself intact.
|
||||
inst.name = llvmInst.Name()
|
||||
inst.operands = []value{
|
||||
|
|
|
@ -12,7 +12,7 @@ package interp
|
|||
// done in interp and results in a revert.
|
||||
//
|
||||
// Right now the memory is assumed to be little endian. This will need an update
|
||||
// for big endian arcitectures, if TinyGo ever adds support for one.
|
||||
// for big endian architectures, if TinyGo ever adds support for one.
|
||||
|
||||
import (
|
||||
"encoding/binary"
|
||||
|
|
|
@ -46,7 +46,7 @@ type channelBlockedList struct {
|
|||
|
||||
// t is the task associated with this channel operation.
|
||||
// If this channel operation is not part of a select, then the pointer field of the state holds the data buffer.
|
||||
// If this channel operation is part of a select, then the pointer field of the state holds the recieve buffer.
|
||||
// If this channel operation is part of a select, then the pointer field of the state holds the receive buffer.
|
||||
// If this channel operation is a receive, then the data field should be set to zero when resuming due to channel closure.
|
||||
t *task.Task
|
||||
|
||||
|
@ -319,10 +319,10 @@ func (ch *channel) trySend(value unsafe.Pointer) bool {
|
|||
interrupt.Restore(i)
|
||||
return false
|
||||
case chanStateRecv:
|
||||
// unblock reciever
|
||||
// unblock receiver
|
||||
dst := ch.resumeRX(true)
|
||||
|
||||
// copy value to reciever
|
||||
// copy value to receiver
|
||||
memcpy(dst, value, ch.elementSize)
|
||||
|
||||
// change state to empty if there are no more receivers
|
||||
|
@ -348,12 +348,12 @@ func (ch *channel) trySend(value unsafe.Pointer) bool {
|
|||
return false
|
||||
}
|
||||
|
||||
// try to recieve a value from a channel, without really blocking
|
||||
// returns whether a value was recieved
|
||||
// try to receive a value from a channel, without really blocking
|
||||
// returns whether a value was received
|
||||
// second return is the comma-ok value
|
||||
func (ch *channel) tryRecv(value unsafe.Pointer) (bool, bool) {
|
||||
if ch == nil {
|
||||
// recieve from nil channel blocks forever
|
||||
// receive from nil channel blocks forever
|
||||
// this is non-blocking, so just say no
|
||||
return false, false
|
||||
}
|
||||
|
@ -402,7 +402,7 @@ func (ch *channel) tryRecv(value unsafe.Pointer) (bool, bool) {
|
|||
interrupt.Restore(i)
|
||||
return false, false
|
||||
case chanStateRecv, chanStateEmpty:
|
||||
// something else is already waiting to recieve
|
||||
// something else is already waiting to receive
|
||||
interrupt.Restore(i)
|
||||
return false, false
|
||||
case chanStateClosed:
|
||||
|
@ -411,7 +411,7 @@ func (ch *channel) tryRecv(value unsafe.Pointer) (bool, bool) {
|
|||
return true, true
|
||||
}
|
||||
|
||||
// channel closed - nothing to recieve
|
||||
// channel closed - nothing to receive
|
||||
memzero(value, ch.elementSize)
|
||||
interrupt.Restore(i)
|
||||
return true, false
|
||||
|
@ -426,8 +426,8 @@ func (ch *channel) tryRecv(value unsafe.Pointer) (bool, bool) {
|
|||
type chanState uint8
|
||||
|
||||
const (
|
||||
chanStateEmpty chanState = iota // nothing in channel, no senders/recievers
|
||||
chanStateRecv // nothing in channel, recievers waiting
|
||||
chanStateEmpty chanState = iota // nothing in channel, no senders/receivers
|
||||
chanStateRecv // nothing in channel, receivers waiting
|
||||
chanStateSend // senders waiting, buffer full if present
|
||||
chanStateBuf // buffer not empty, no senders waiting
|
||||
chanStateClosed // channel closed
|
||||
|
@ -477,7 +477,7 @@ func chanSend(ch *channel, value unsafe.Pointer, blockedlist *channelBlockedList
|
|||
deadlock()
|
||||
}
|
||||
|
||||
// wait for reciever
|
||||
// wait for receiver
|
||||
sender := task.Current()
|
||||
ch.state = chanStateSend
|
||||
sender.Ptr = value
|
||||
|
@ -493,8 +493,8 @@ func chanSend(ch *channel, value unsafe.Pointer, blockedlist *channelBlockedList
|
|||
}
|
||||
|
||||
// chanRecv receives a single value over a channel.
|
||||
// It blocks if there is no available value to recieve.
|
||||
// The recieved value is copied into the value pointer.
|
||||
// It blocks if there is no available value to receive.
|
||||
// The received value is copied into the value pointer.
|
||||
// Returns the comma-ok value.
|
||||
func chanRecv(ch *channel, value unsafe.Pointer, blockedlist *channelBlockedList) bool {
|
||||
i := interrupt.Disable()
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
// symbols from the included files in the reference implementation directly into
|
||||
// the source. It has also been modified to include the conditional logic from
|
||||
// the CircuitPython implementation that supports additional flash chips. The
|
||||
// CiruitPython source is here:
|
||||
// CircuitPython source is here:
|
||||
// https://github.com/adafruit/circuitpython/blob/main/ports/raspberrypi/stage2.c.jinja
|
||||
//
|
||||
// This file cannot be assembled directly, instead assemble the board-specific file
|
||||
|
|
12
testdata/channel.go
предоставленный
12
testdata/channel.go
предоставленный
|
@ -158,16 +158,16 @@ func main() {
|
|||
ch = make(chan int, 2)
|
||||
ch <- 1
|
||||
ch <- 2
|
||||
println("non-concurrent channel recieve:", <-ch)
|
||||
println("non-concurrent channel recieve:", <-ch)
|
||||
println("non-concurrent channel receive:", <-ch)
|
||||
println("non-concurrent channel receive:", <-ch)
|
||||
|
||||
// test closing channels with buffered data
|
||||
ch <- 3
|
||||
ch <- 4
|
||||
close(ch)
|
||||
println("closed buffered channel recieve:", <-ch)
|
||||
println("closed buffered channel recieve:", <-ch)
|
||||
println("closed buffered channel recieve:", <-ch)
|
||||
println("closed buffered channel receive:", <-ch)
|
||||
println("closed buffered channel receive:", <-ch)
|
||||
println("closed buffered channel receive:", <-ch)
|
||||
|
||||
// test using buffered channels as regular channels with special properties
|
||||
wg.Add(6)
|
||||
|
@ -184,7 +184,7 @@ func main() {
|
|||
for range ch {
|
||||
count++
|
||||
}
|
||||
println("hybrid buffered channel recieve:", count)
|
||||
println("hybrid buffered channel receive:", count)
|
||||
|
||||
// test blocking selects
|
||||
ch = make(chan int)
|
||||
|
|
12
testdata/channel.txt
предоставленный
12
testdata/channel.txt
предоставленный
|
@ -26,10 +26,10 @@ select n from chan: 55
|
|||
select n from closed chan: 0
|
||||
select send
|
||||
sum: 235
|
||||
non-concurrent channel recieve: 1
|
||||
non-concurrent channel recieve: 2
|
||||
closed buffered channel recieve: 3
|
||||
closed buffered channel recieve: 4
|
||||
closed buffered channel recieve: 0
|
||||
hybrid buffered channel recieve: 2
|
||||
non-concurrent channel receive: 1
|
||||
non-concurrent channel receive: 2
|
||||
closed buffered channel receive: 3
|
||||
closed buffered channel receive: 4
|
||||
closed buffered channel receive: 0
|
||||
hybrid buffered channel receive: 2
|
||||
blocking select sum: 3
|
||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче