Skip to content

Commit ed8a939

Browse files
committed
[#32] Make Stack sendable
1 parent 8439f76 commit ed8a939

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "context"
3-
version = "1.0.0"
3+
version = "1.0.1"
44
authors = ["Y. T. Chung <zonyitoo@gmail.com>", "Leonard Hecker <leonard@hecker.io>"]
55
license = "MIT/Apache-2.0"
66
repository = "https://github.com/zonyitoo/context-rs"

src/stack.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,7 @@ impl Stack {
8888
let page_size = sys::page_size();
8989
let min_stack_size = sys::min_stack_size();
9090
let max_stack_size = sys::max_stack_size();
91-
let add_shift = if protected {
92-
1
93-
} else {
94-
0
95-
};
91+
let add_shift = if protected { 1 } else { 0 };
9692
let add = page_size << add_shift;
9793

9894
if size < min_stack_size {
@@ -119,6 +115,8 @@ impl Stack {
119115
}
120116
}
121117

118+
unsafe impl Send for Stack {}
119+
122120
/// A very simple and straightforward implementation of `Stack`.
123121
///
124122
/// Allocates stack space using virtual memory, whose pages will

0 commit comments

Comments
 (0)