summaryrefslogtreecommitdiff
path: root/minheap-internal.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2010-03-26 13:56:01 -0400
committerNick Mathewson <nickm@torproject.org>2010-03-26 13:56:01 -0400
commita5276180b790fd3571a8e157c1fdd1a296421681 (patch)
treec644a8b147ee37a3c6f1038c13498aaf8d8f4714 /minheap-internal.h
parent7204b916669f9b9ff0dae689088a5ab0344edebd (diff)
downloadlibevent-a5276180b790fd3571a8e157c1fdd1a296421681.tar.gz
Fix minheap code to use replacement malloc functions
minheap-internal.h still had an extra realloc and an extra free that needed to be replaced with mm_realloc and mm_free().
Diffstat (limited to 'minheap-internal.h')
-rw-r--r--minheap-internal.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/minheap-internal.h b/minheap-internal.h
index f877e55e..8253dfe7 100644
--- a/minheap-internal.h
+++ b/minheap-internal.h
@@ -33,6 +33,7 @@
#include "event2/event_struct.h"
#include "event2/util.h"
#include "util-internal.h"
+#include "mm-internal.h"
typedef struct min_heap
{
@@ -61,7 +62,7 @@ int min_heap_elem_greater(struct event *a, struct event *b)
}
void min_heap_ctor(min_heap_t* s) { s->p = 0; s->n = 0; s->a = 0; }
-void min_heap_dtor(min_heap_t* s) { free(s->p); }
+void min_heap_dtor(min_heap_t* s) { mm_free(s->p); }
void min_heap_elem_init(struct event* e) { e->ev_timeout_pos.min_heap_idx = -1; }
int min_heap_empty(min_heap_t* s) { return 0u == s->n; }
unsigned min_heap_size(min_heap_t* s) { return s->n; }
@@ -121,7 +122,7 @@ int min_heap_reserve(min_heap_t* s, unsigned n)
unsigned a = s->a ? s->a * 2 : 8;
if (a < n)
a = n;
- if (!(p = (struct event**)realloc(s->p, a * sizeof *p)))
+ if (!(p = (struct event**)mm_realloc(s->p, a * sizeof *p)))
return -1;
s->p = p;
s->a = a;