mirror of
https://github.com/Hizenberg469/Timer-Library.git
synced 2026-04-19 17:52:26 +03:00
Important comments added
This commit is contained in:
@@ -53,6 +53,20 @@ typedef struct _wheel_timer_t {
|
|||||||
Timer_t* wheel_thread;
|
Timer_t* wheel_thread;
|
||||||
slotlist_t reschd_list;
|
slotlist_t reschd_list;
|
||||||
unsigned int no_of_wt_elem;
|
unsigned int no_of_wt_elem;
|
||||||
|
|
||||||
|
/*Note*/
|
||||||
|
/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
|
||||||
|
/*
|
||||||
|
* This is type of error which zero elements.
|
||||||
|
* This type of declaration is used to allocate
|
||||||
|
* contigious memory to array when they are a part
|
||||||
|
* of structure and they are dynamically allocated
|
||||||
|
* during allocation of memory of object the same
|
||||||
|
* structure.
|
||||||
|
*
|
||||||
|
* structure ---> [ pro1, pro2, pro3, arr[..........] ]
|
||||||
|
*/
|
||||||
|
/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
|
||||||
slotlist_t slotlist[0];
|
slotlist_t slotlist[0];
|
||||||
} wheel_timer_t;
|
} wheel_timer_t;
|
||||||
|
|
||||||
|
|||||||
@@ -133,8 +133,10 @@ wheel_fn(Timer_t* timer, void* arg) {
|
|||||||
wheel_timer_t*
|
wheel_timer_t*
|
||||||
init_wheel_timer(int wheel_size, int clock_tic_interval) {
|
init_wheel_timer(int wheel_size, int clock_tic_interval) {
|
||||||
|
|
||||||
|
/*@@@@@@@@@@@@@@@@@@@*/
|
||||||
wheel_timer_t* wt = calloc(1, sizeof(wheel_timer_t) +
|
wheel_timer_t* wt = calloc(1, sizeof(wheel_timer_t) +
|
||||||
(wheel_size * sizeof(slotlist_t)));
|
(wheel_size * sizeof(slotlist_t)));
|
||||||
|
/*@@@@@@@@@@@@@@@@@@@*/
|
||||||
|
|
||||||
wt->clock_tic_interval = clock_tic_interval;
|
wt->clock_tic_interval = clock_tic_interval;
|
||||||
wt->wheel_size = wheel_size;
|
wt->wheel_size = wheel_size;
|
||||||
|
|||||||
Reference in New Issue
Block a user