2 // Copyright (c) 2010-2017 Intel Corporation
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://www.apache.org/licenses/LICENSE-2.0
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
24 struct heap_elem *elem; /* timer management */
29 struct heap_elem *top;
31 struct heap_elem *avail[0];
34 static uint64_t heap_n_elems(const struct heap *h)
39 static int heap_is_empty(const struct heap *h)
44 int heap_top_is_lower(struct heap *h, uint64_t prio);
46 void heap_print(struct heap *h, char *result, size_t buf_len);
48 struct heap *heap_create(uint32_t max_elems, int socket_id);
49 void heap_add(struct heap *h, struct heap_ref *ref, uint64_t priority);
50 void heap_del(struct heap *h, struct heap_ref *del);
51 struct heap_ref *heap_pop(struct heap *h);