1
This commit is contained in:
parent
51ffb10af3
commit
3247ff5f40
17
src/timer.rs
17
src/timer.rs
@ -2,12 +2,12 @@ use std::rc::{Rc, Weak};
|
|||||||
use std::cell::RefCell;
|
use std::cell::RefCell;
|
||||||
|
|
||||||
const CONFIG_BASE_SMALL: bool = false;
|
const CONFIG_BASE_SMALL: bool = false;
|
||||||
const TVN_BITS: i32 = 6;
|
const TVN_BITS: usize = 6;
|
||||||
const TVR_BITS: i32 = 8;
|
const TVR_BITS: usize = 8;
|
||||||
const TVN_SIZE: i32 = 1 << TVN_BITS;
|
const TVN_SIZE: usize = 1 << TVN_BITS;
|
||||||
const TVR_SIZE: i32 = 1 << TVR_BITS;
|
const TVR_SIZE: usize = 1 << TVR_BITS;
|
||||||
const TVN_MASK: i32 = TVN_SIZE - 1;
|
const TVN_MASK: usize = TVN_SIZE - 1;
|
||||||
const TVR_MASK: i32 = TVR_SIZE - 1;
|
const TVR_MASK: usize = TVR_SIZE - 1;
|
||||||
|
|
||||||
pub struct TimerList {
|
pub struct TimerList {
|
||||||
|
|
||||||
@ -20,6 +20,11 @@ pub struct Timer {
|
|||||||
timer_tick: i64,
|
timer_tick: i64,
|
||||||
get_tick_count: fn () -> i64,
|
get_tick_count: fn () -> i64,
|
||||||
cache_timer_num: i32,
|
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 {
|
impl Timer {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user