Skip to content

Commit 718b6e1

Browse files
committed
Replace references to foo with start in DMA
The example code didn't match the text underneath.
1 parent 9621a6b commit 718b6e1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/dma.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,12 @@ not the case; consider the following example:
8484
{{#include ../ci/dma/examples/one.rs:105:112}}
8585
```
8686

87-
Here we start a DMA transfer, in `foo`, to fill an array allocated on the stack
88-
and then `mem::forget` the returned `Transfer` value. Then we proceed to return
89-
from `foo` and execute the function `bar`.
87+
Here we start a DMA transfer, in `start`, to fill an array allocated on the
88+
stack and then `mem::forget` the returned `Transfer` value. Then we proceed to
89+
return from `start` and execute the function `bar`.
9090

9191
This series of operations results in undefined behavior. The DMA transfer writes
92-
to stack memory but that memory is released when `foo` returns and then reused
92+
to stack memory but that memory is released when `start` returns and then reused
9393
by `bar` to allocate variables like `x` and `y`. At runtime this could result in
9494
variables `x` and `y` changing their value at random times. The DMA transfer
9595
could also overwrite the state (e.g. link register) pushed onto the stack by the

0 commit comments

Comments
 (0)