Add heap debug option, fix heap.
[lttng-modules.git] / lib / prio_heap / prio_heap.h
index 2674db21fb8496d5e5a7ceacd5ad26ce1af756f6..2b55adf2e68401ab7a66627fe35e8c4fa85a3104 100644 (file)
@@ -28,6 +28,15 @@ struct ptr_heap {
        gfp_t gfpmask;
 };
 
+#ifdef DEBUG_HEAP
+void check_heap(const struct ptr_heap *heap);
+#else
+static inline
+void check_heap(const struct ptr_heap *heap)
+{
+}
+#endif
+
 /**
  * heap_maximum - return the largest element in the heap
  * @heap: the heap to be operated on
@@ -37,6 +46,7 @@ struct ptr_heap {
  */
 static inline void *heap_maximum(const struct ptr_heap *heap)
 {
+       check_heap(heap);
        return heap->len ? heap->ptrs[0] : NULL;
 }
 
This page took 0.022773 seconds and 4 git commands to generate.