From 51ffb10af386897b67fe63361ecdaa84b8072cd9 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Sat, 7 Oct 2023 19:28:42 +0800 Subject: [PATCH] 1 --- src/timer.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/timer.rs b/src/timer.rs index 6e5500d..ff36b6d 100644 --- a/src/timer.rs +++ b/src/timer.rs @@ -1,6 +1,14 @@ 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; + pub struct TimerList { } @@ -9,14 +17,15 @@ pub struct Timer { free_timer_num: i32, free_timer_list: Rc::>>, running_timer: Weak::>, + timer_tick: i64, + get_tick_count: fn () -> i64, + cache_timer_num: i32, } impl Timer { pub fn init(&mut self, get_tick_count: fn () -> i64, - get_fxied_timer_expires: fn (i32, i64) -> i64, - context: (), gctime: i32, cache_timer_num: i32) {