summaryrefslogtreecommitdiffstats
path: root/lib/isc/heap.c
diff options
context:
space:
mode:
authordougb <dougb@FreeBSD.org>2011-09-01 05:24:42 +0000
committerdougb <dougb@FreeBSD.org>2011-09-01 05:24:42 +0000
commitada65d99fb1417107a796d4d82e039f1d9a956a0 (patch)
treef929ac955ed5ffe7020bc29e63139cb1c4d71c57 /lib/isc/heap.c
parent25b6a0332b63209d2c179bbe5581562e79f3d168 (diff)
downloadFreeBSD-src-ada65d99fb1417107a796d4d82e039f1d9a956a0.zip
FreeBSD-src-ada65d99fb1417107a796d4d82e039f1d9a956a0.tar.gz
Vendor import of BIND 9.8.1
Diffstat (limited to 'lib/isc/heap.c')
-rw-r--r--lib/isc/heap.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/isc/heap.c b/lib/isc/heap.c
index 4dead3f..eeef7f7 100644
--- a/lib/isc/heap.c
+++ b/lib/isc/heap.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004-2007, 2010 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2007, 2010, 2011 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1997-2001 Internet Software Consortium.
*
* Permission to use, copy, modify, and/or distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: heap.c,v 1.39 2010-02-04 23:49:13 tbox Exp $ */
+/* $Id: heap.c,v 1.39.150.2 2011-03-03 23:47:09 tbox Exp $ */
/*! \file
* Heap implementation of priority queues adapted from the following:
@@ -86,8 +86,9 @@ isc_heap_create(isc_mem_t *mctx, isc_heapcompare_t compare,
if (heap == NULL)
return (ISC_R_NOMEMORY);
heap->magic = HEAP_MAGIC;
- heap->mctx = mctx;
heap->size = 0;
+ heap->mctx = NULL;
+ isc_mem_attach(mctx, &heap->mctx);
if (size_increment == 0)
heap->size_increment = SIZE_INCREMENT;
else
@@ -114,7 +115,7 @@ isc_heap_destroy(isc_heap_t **heapp) {
isc_mem_put(heap->mctx, heap->array,
heap->size * sizeof(void *));
heap->magic = 0;
- isc_mem_put(heap->mctx, heap, sizeof(*heap));
+ isc_mem_putanddetach(&heap->mctx, heap, sizeof(*heap));
*heapp = NULL;
}
OpenPOWER on IntegriCloud