Skip to content

Commit a317c29

Browse files
committed
---
yaml --- r: 174286 b: refs/heads/snap-stage3 c: a03701d h: refs/heads/master v: v3
1 parent 7db9d5e commit a317c29

File tree

2 files changed

+1
-24
lines changed

2 files changed

+1
-24
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: a833337943300db1c310a4cf9c84b7b4ef4e9468
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 5f1ba93ad2793a3c8377c98edf3b753618cc2e77
4+
refs/heads/snap-stage3: a03701defaf00f323aeaff033d84d93545448b77
55
refs/heads/try: 08f6380a9f0b866796080094f44fe25ea5636547
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d

branches/snap-stage3/src/doc/trpl/ffi.md

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -164,29 +164,6 @@ pub fn uncompress(src: &[u8]) -> Option<Vec<u8>> {
164164
For reference, the examples used here are also available as an [library on
165165
GitHub](https://github.com/thestinger/rust-snappy).
166166

167-
# Stack management
168-
169-
Rust threads by default run on a *large stack*. This is actually implemented as a
170-
reserving a large segment of the address space and then lazily mapping in pages
171-
as they are needed. When calling an external C function, the code is invoked on
172-
the same stack as the rust stack. This means that there is no extra
173-
stack-switching mechanism in place because it is assumed that the large stack
174-
for the rust thread is plenty for the C function to have.
175-
176-
A planned future improvement (not yet implemented at the time of this writing)
177-
is to have a guard page at the end of every rust stack. No rust function will
178-
hit this guard page (due to Rust's usage of LLVM's `__morestack`). The intention
179-
for this unmapped page is to prevent infinite recursion in C from overflowing
180-
onto other rust stacks. If the guard page is hit, then the process will be
181-
terminated with a message saying that the guard page was hit.
182-
183-
For normal external function usage, this all means that there shouldn't be any
184-
need for any extra effort on a user's perspective. The C stack naturally
185-
interleaves with the rust stack, and it's "large enough" for both to
186-
interoperate. If, however, it is determined that a larger stack is necessary,
187-
there are appropriate functions in the thread spawning API to control the size of
188-
the stack of the thread which is spawned.
189-
190167
# Destructors
191168

192169
Foreign libraries often hand off ownership of resources to the calling code.

0 commit comments

Comments
 (0)