You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/post/stacksafe-taming-recursion-in-rust-without-stack-overflow.mdx
+5-3Lines changed: 5 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -199,7 +199,7 @@ drop(deep_tree); // No stack overflow
199
199
200
200
### Debug-Time Safety Checks
201
201
202
-
`StackSafe<T>` exposes the wrapped value through Rust's `Deref` trait, allowing transparent access to the underlying data. However, it includes an important safety mechanism: in debug builds, it checks whether the current function is properly annotated with `#[stacksafe]` whenever you access the wrapped value.
202
+
`StackSafe<T>` exposes the wrapped value through Rust's `Deref` trait, allowing transparent access to the underlying data. What's more, it includes an important safety mechanism: in debug builds, it checks whether the current function is properly annotated with `#[stacksafe]` whenever you access the wrapped value.
This debug-time checking helps you identify all potential stack overflow locations during development, rather than discovering them in production when they cause crashes.
229
+
This debug-time check helps you identify all potential stack overflow locations during development, rather than discovering them in production when they cause crashes.
230
230
231
231
### Adopting `StackSafe` in Existing Code
232
232
233
233
Converting existing recursive code is straightforward. Here's a real-world example:
0 commit comments