diff options
| author | Steve Klabnik <steve@steveklabnik.com> | 2015-01-12 13:41:37 -0500 |
|---|---|---|
| committer | Steve Klabnik <steve@steveklabnik.com> | 2015-01-17 10:49:49 -0500 |
| commit | a03701defaf00f323aeaff033d84d93545448b77 (patch) | |
| tree | 638398dcbeee11582bd95fd1ae062a7b56662f05 | |
| parent | 5f1ba93ad2793a3c8377c98edf3b753618cc2e77 (diff) | |
| download | rust-a03701defaf00f323aeaff033d84d93545448b77.tar.gz rust-a03701defaf00f323aeaff033d84d93545448b77.zip | |
Remove segmented stack info from the FFI chapter of the book.
Fixes #20071.
| -rw-r--r-- | src/doc/trpl/ffi.md | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/src/doc/trpl/ffi.md b/src/doc/trpl/ffi.md index 940d2c968be..32b60f0a81d 100644 --- a/src/doc/trpl/ffi.md +++ b/src/doc/trpl/ffi.md @@ -164,29 +164,6 @@ pub fn uncompress(src: &[u8]) -> Option<Vec<u8>> { For reference, the examples used here are also available as an [library on GitHub](https://github.com/thestinger/rust-snappy). -# Stack management - -Rust threads by default run on a *large stack*. This is actually implemented as a -reserving a large segment of the address space and then lazily mapping in pages -as they are needed. When calling an external C function, the code is invoked on -the same stack as the rust stack. This means that there is no extra -stack-switching mechanism in place because it is assumed that the large stack -for the rust thread is plenty for the C function to have. - -A planned future improvement (not yet implemented at the time of this writing) -is to have a guard page at the end of every rust stack. No rust function will -hit this guard page (due to Rust's usage of LLVM's `__morestack`). The intention -for this unmapped page is to prevent infinite recursion in C from overflowing -onto other rust stacks. If the guard page is hit, then the process will be -terminated with a message saying that the guard page was hit. - -For normal external function usage, this all means that there shouldn't be any -need for any extra effort on a user's perspective. The C stack naturally -interleaves with the rust stack, and it's "large enough" for both to -interoperate. If, however, it is determined that a larger stack is necessary, -there are appropriate functions in the thread spawning API to control the size of -the stack of the thread which is spawned. - # Destructors Foreign libraries often hand off ownership of resources to the calling code. |
