File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed
Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -1325,3 +1325,8 @@ void termination(void) {
13251325 }
13261326 lf_tracing_global_shutdown ();
13271327}
1328+
1329+ index_t lf_combine_deadline_and_level (interval_t deadline , int level ) {
1330+ if (deadline > ULLONG_MAX >> 16 ) return ((ULLONG_MAX >> 16 ) << 16 ) | level ;
1331+ else return (deadline << 16 ) | level ;
1332+ }
Original file line number Diff line number Diff line change @@ -65,6 +65,16 @@ extern struct allocation_record_t* _lf_reactors_to_free;
6565
6666////////////////////// Functions //////////////////////
6767
68+ /**
69+ * @brief Combine a deadline and a level into a single index for sorting in the reaction queue.
70+ *
71+ * This shifts the deadline right by 16 bits and inserts the level in the low-order 16 bits.
72+ * If the deadline is larger than `ULLONG_MAX >> 16`, then it is treated as the largest possible deadline.
73+ * @oaran deadline THe deadline.
74+ * @param level The level in the reaction graph.
75+ */
76+ index_t lf_combine_deadline_and_level (interval_t deadline , int level );
77+
6878/**
6979 * @brief Create and initialize the required number of environments for the program.
7080 * @note This function will be code generated by the compiler.
You can’t perform that action at this time.
0 commit comments