This commit is contained in:
aozhiwei 2023-10-07 20:44:12 +08:00
parent 51ffb10af3
commit 3247ff5f40

View File

@ -2,12 +2,12 @@ use std::rc::{Rc, Weak};
use std::cell::RefCell;
const CONFIG_BASE_SMALL: bool = false;
const TVN_BITS: i32 = 6;
const TVR_BITS: i32 = 8;
const TVN_SIZE: i32 = 1 << TVN_BITS;
const TVR_SIZE: i32 = 1 << TVR_BITS;
const TVN_MASK: i32 = TVN_SIZE - 1;
const TVR_MASK: i32 = TVR_SIZE - 1;
const TVN_BITS: usize = 6;
const TVR_BITS: usize = 8;
const TVN_SIZE: usize = 1 << TVN_BITS;
const TVR_SIZE: usize = 1 << TVR_BITS;
const TVN_MASK: usize = TVN_SIZE - 1;
const TVR_MASK: usize = TVR_SIZE - 1;
pub struct TimerList {
@ -20,6 +20,11 @@ pub struct Timer {
timer_tick: i64,
get_tick_count: fn () -> i64,
cache_timer_num: i32,
tv1: [Rc::<RefCell::<crate::ListHead<TimerList>>>; TVR_SIZE],
tv2: [Rc::<RefCell::<crate::ListHead<TimerList>>>; TVN_SIZE],
tv3: [Rc::<RefCell::<crate::ListHead<TimerList>>>; TVN_SIZE],
tv4: [Rc::<RefCell::<crate::ListHead<TimerList>>>; TVN_SIZE],
tv5: [Rc::<RefCell::<crate::ListHead<TimerList>>>; TVN_SIZE],
}
impl Timer {