Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
prio_heap.h
Go to the documentation of this file.
1 #ifndef _LINUX_PRIO_HEAP_H
2 #define _LINUX_PRIO_HEAP_H
3 
4 /*
5  * Simple insertion-only static-sized priority heap containing
6  * pointers, based on CLR, chapter 7
7  */
8 
9 #include <linux/gfp.h>
10 
18 struct ptr_heap {
19  void **ptrs;
20  int max;
21  int size;
22  int (*gt)(void *, void *);
23 };
24 
32 extern int heap_init(struct ptr_heap *heap, size_t size, gfp_t gfp_mask,
33  int (*gt)(void *, void *));
34 
39 void heap_free(struct ptr_heap *heap);
40 
54 extern void *heap_insert(struct ptr_heap *heap, void *p);
55 
56 
57 
58 #endif /* _LINUX_PRIO_HEAP_H */