// Copyright (c) 2023, Marvin Borner // SPDX-License-Identifier: MIT #include #include #include #include static struct pqueue *queue; static pqueue_pri_t get_pri(void *a) { struct term *term = a; return (parse_get_max_depth() - term->depth + 1) * term->refs; } static int cmp_pri(pqueue_pri_t next, pqueue_pri_t curr) { return next < curr; } static void set_pos(void *a, size_t position) { (void)a; (void)position; } void schedule_init(void) { queue = map_to_pqueue(cmp_pri, get_pri, set_pos); } void schedule_destroy(void) { pqueue_free(queue); }