4 * This file and its contents are supplied under the terms of the
5 * Common Development and Distribution License ("CDDL"), version 1.0.
6 * You may only use this file in accordance with the terms of version
9 * A full copy of the text of the CDDL should have accompanied this
10 * source. A copy of the CDDL is also available via the Internet at
11 * http://www.illumos.org/license/CDDL.
17 * Copyright (c) 2012 by Delphix. All rights reserved.
29 typedef uint64_t (*dt_pq_value_f
)(void *, void *);
31 typedef struct dt_pq
{
32 dtrace_hdl_t
*dtpq_hdl
; /* dtrace handle */
33 void **dtpq_items
; /* array of elements */
34 uint_t dtpq_size
; /* count of allocated elements */
35 uint_t dtpq_last
; /* next free slot */
36 dt_pq_value_f dtpq_value
; /* callback to get the value */
37 void *dtpq_arg
; /* callback argument */
40 extern dt_pq_t
*dt_pq_init(dtrace_hdl_t
*, uint_t size
, dt_pq_value_f
, void *);
41 extern void dt_pq_fini(dt_pq_t
*);
43 extern void dt_pq_insert(dt_pq_t
*, void *);
44 extern void *dt_pq_pop(dt_pq_t
*);
45 extern void *dt_pq_walk(dt_pq_t
*, uint_t
*);