File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -233,6 +233,29 @@ different Miri binaries, and as such worth documenting:
233
233
interpret the code but compile it like rustc would. This is useful to be sure
234
234
that the compiled ` rlib ` s are compatible with Miri.
235
235
236
+ ## Miri ` extern ` functions
237
+
238
+ Miri provides some ` extern ` functions that programs can import to access
239
+ Miri-specific functionality:
240
+
241
+ ``` rust
242
+ #[cfg(miri)]
243
+ extern " Rust" {
244
+ /// Miri-provided extern function to mark the block `ptr` points to as a "root"
245
+ /// for some static memory. This memory and everything reachable by it is not
246
+ /// considered leaking even if it still exists when the program terminates.
247
+ ///
248
+ /// `ptr` has to point to the beginning of an allocated block.
249
+ fn miri_static_root (ptr : * const u8 );
250
+
251
+ /// Miri-provided extern function to begin unwinding with the given payload.
252
+ ///
253
+ /// This is internal and unstable and should not be used; we give it here
254
+ /// just to be complete.
255
+ fn miri_start_panic (payload : * mut u8 ) -> ! ;
256
+ }
257
+ ```
258
+
236
259
## Contributing and getting help
237
260
238
261
If you want to contribute to Miri, great! Please check out our
You can’t perform that action at this time.
0 commit comments