From 3247ff5f4093d1fe1e6e5095629f49b234926f46 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Sat, 7 Oct 2023 20:44:12 +0800 Subject: [PATCH] 1 --- src/timer.rs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/timer.rs b/src/timer.rs index ff36b6d..15b1bc3 100644 --- a/src/timer.rs +++ b/src/timer.rs @@ -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::>>; TVR_SIZE], + tv2: [Rc::>>; TVN_SIZE], + tv3: [Rc::>>; TVN_SIZE], + tv4: [Rc::>>; TVN_SIZE], + tv5: [Rc::>>; TVN_SIZE], } impl Timer {