projects
/
babeltrace.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add heap debug option, fix heap
[babeltrace.git]
/
include
/
babeltrace
/
prio_heap.h
diff --git
a/include/babeltrace/prio_heap.h
b/include/babeltrace/prio_heap.h
index 51cdac56c26d693a9a655f2318c8b81d3e2c67b8..1a523313f84134d07f75f3c547a294dd6128c0a7 100644
(file)
--- a/
include/babeltrace/prio_heap.h
+++ b/
include/babeltrace/prio_heap.h
@@
-28,6
+28,15
@@
struct ptr_heap {
int (*gt)(void *a, void *b);
};
int (*gt)(void *a, void *b);
};
+#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
/**
* 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)
{
*/
static inline void *heap_maximum(const struct ptr_heap *heap)
{
+ check_heap(heap);
return heap->len ? heap->ptrs[0] : NULL;
}
return heap->len ? heap->ptrs[0] : NULL;
}
This page took
0.022865 seconds
and
4
git commands to generate.