about summary refs log tree commit diff
path: root/src/libgreen/task.rs
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2014-01-04 00:06:13 -0800
committerAlex Crichton <alex@alexcrichton.com>2014-01-04 00:08:03 -0800
commitdcaf10f8de7be79d7ef8aa5e048bf6535108dc16 (patch)
tree2a5a09d84e6db2421076fe36f407f736e989266e /src/libgreen/task.rs
parenta1cb8dc30c6adc88703763a8703b6a3027598b2d (diff)
downloadrust-dcaf10f8de7be79d7ef8aa5e048bf6535108dc16.tar.gz
rust-dcaf10f8de7be79d7ef8aa5e048bf6535108dc16.zip
Add a stack_bounds function to the Runtime trait
This allows inspection of the current task's bounds regardless of what the
underlying task is.

Closes #11293
Diffstat (limited to 'src/libgreen/task.rs')
-rw-r--r--src/libgreen/task.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libgreen/task.rs b/src/libgreen/task.rs
index fc4e1c08ba5..183fe8d0555 100644
--- a/src/libgreen/task.rs
+++ b/src/libgreen/task.rs
@@ -450,6 +450,13 @@ impl Runtime for GreenTask {
         }
     }
 
+    fn stack_bounds(&self) -> Option<(uint, uint)> {
+        self.coroutine.as_ref().map(|c| {
+            (c.current_stack_segment.start() as uint,
+             c.current_stack_segment.end() as uint)
+        })
+    }
+
     fn wrap(~self) -> ~Any { self as ~Any }
 }