Skip to content

Commit

Permalink
try pass x86 win CI
Browse files Browse the repository at this point in the history
  • Loading branch information
loongs-zhang committed Dec 23, 2024
1 parent 62e8375 commit f4ac5d6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion core/src/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ pub fn default_red_zone() -> usize {
if ret == 0 {
cfg_if::cfg_if! {
if #[cfg(windows)] {
ret = 32 * 1024 + page_size() * 3;
ret = 32 * 1024 + page_size() * 8;
} else {
ret = 16 * 1024 + page_size();
}
Expand Down
12 changes: 8 additions & 4 deletions core/src/coroutine/stack_pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@ impl Ord for PooledStack {
// BinaryHeap defaults to a large top heap, but we need a small top heap
match Rc::strong_count(&other.stack).cmp(&Rc::strong_count(&self.stack)) {
Ordering::Less => Ordering::Less,
Ordering::Equal => other.stack_size.cmp(&self.stack_size),
Ordering::Equal => match other.stack_size.cmp(&self.stack_size) {
Ordering::Less => Ordering::Less,
Ordering::Equal => other.create_time.cmp(&self.create_time),
Ordering::Greater => Ordering::Greater,
},
Ordering::Greater => Ordering::Greater,
}
}
Expand Down Expand Up @@ -102,11 +106,11 @@ unsafe impl Stack for PooledStack {
}

impl PooledStack {
pub(crate) fn new(stack_size: usize, create_time: u64) -> std::io::Result<Self> {
pub(crate) fn new(stack_size: usize) -> std::io::Result<Self> {
Ok(Self {
stack_size,
stack: Rc::new(UnsafeCell::new(DefaultStack::new(stack_size)?)),
create_time,
create_time: now(),
})
}

Expand Down Expand Up @@ -199,7 +203,7 @@ impl StackPool {
not_use.push(stack);
}
}
let stack = PooledStack::new(stack_size, now())?;
let stack = PooledStack::new(stack_size)?;
heap.push(stack.clone());
self.add_len();
Ok(stack)
Expand Down

0 comments on commit f4ac5d6

Please sign in to comment.