Home
last modified time | relevance | path

Searched refs:heap (Results 1 – 25 of 536) sorted by relevance

12345678910>>...22

/netbsd-src/external/mpl/dhcp/bind/dist/lib/isc/
H A Dheap.c57 !heap->compare(heap->array[(i)], heap->array[heap_parent(i)]))
73 heap_check(isc_heap_t *heap) { in heap_check() argument
75 for (i = 1; i <= heap->last; i++) { in heap_check()
86 isc_heap_t *heap; in isc_heap_create() local
91 heap = isc_mem_get(mctx, sizeof(*heap)); in isc_heap_create()
92 heap->magic = HEAP_MAGIC; in isc_heap_create()
93 heap->size = 0; in isc_heap_create()
94 heap->mctx = NULL; in isc_heap_create()
95 isc_mem_attach(mctx, &heap->mctx); in isc_heap_create()
97 heap->size_increment = SIZE_INCREMENT; in isc_heap_create()
[all …]
/netbsd-src/external/mpl/bind/dist/lib/isc/
H A Dheap.c1 /* $NetBSD: heap.c,v 1.8 2025/01/26 16:25:37 christos Exp $ */
28 #include <isc/heap.h>
38 * element of the heap array is not used; i.e. heap subscripts are 1-based,
52 * When the heap is in a consistent state, the following invariant
58 !heap->compare(heap->array[(i)], heap->array[heap_parent(i)]))
60 /*% ISC heap structure. */
74 heap_check(isc_heap_t *heap) { in heap_check()
73 heap_check(isc_heap_t * heap) heap_check() argument
86 isc_heap_t *heap; isc_heap_create() local
111 isc_heap_t *heap; isc_heap_destroy() local
127 resize(isc_heap_t * heap) resize() argument
145 float_up(isc_heap_t * heap,unsigned int i,void * elt) float_up() argument
166 sink_down(isc_heap_t * heap,unsigned int i,void * elt) sink_down() argument
197 isc_heap_insert(isc_heap_t * heap,void * elt) isc_heap_insert() argument
214 isc_heap_delete(isc_heap_t * heap,unsigned int idx) isc_heap_delete() argument
245 isc_heap_increased(isc_heap_t * heap,unsigned int idx) isc_heap_increased() argument
253 isc_heap_decreased(isc_heap_t * heap,unsigned int idx) isc_heap_decreased() argument
261 isc_heap_element(isc_heap_t * heap,unsigned int idx) isc_heap_element() argument
273 isc_heap_foreach(isc_heap_t * heap,isc_heapaction_t action,void * uap) isc_heap_foreach() argument
[all...]
/netbsd-src/external/gpl3/gcc/dist/libiberty/
H A Dfibheap.c76 fibheap_compare (fibheap_t heap ATTRIBUTE_UNUSED, fibnode_t a, fibnode_t b) in fibheap_compare()
86 fibheap_comp_data (fibheap_t heap, fibheapkey_t key, void *data, fibnode_t b) in fibheap_comp_data() argument
93 return fibheap_compare (heap, &a, b); in fibheap_comp_data()
98 fibheap_insert (fibheap_t heap, fibheapkey_t key, void *data) in fibheap_insert() argument
110 fibheap_ins_root (heap, node); in fibheap_insert()
114 if (heap->min == NULL || node->key < heap->min->key) in fibheap_insert()
115 heap->min = node; in fibheap_insert()
117 heap->nodes++; in fibheap_insert()
124 fibheap_min (fibheap_t heap) in fibheap_min() argument
127 if (heap->min == NULL) in fibheap_min()
[all …]
/netbsd-src/external/gpl3/binutils.old/dist/libiberty/
H A Dfibheap.c76 fibheap_compare (fibheap_t heap ATTRIBUTE_UNUSED, fibnode_t a, fibnode_t b) in fibheap_compare()
86 fibheap_comp_data (fibheap_t heap, fibheapkey_t key, void *data, fibnode_t b) in fibheap_comp_data() argument
93 return fibheap_compare (heap, &a, b); in fibheap_comp_data()
98 fibheap_insert (fibheap_t heap, fibheapkey_t key, void *data) in fibheap_insert() argument
110 fibheap_ins_root (heap, node); in fibheap_insert()
114 if (heap->min == NULL || node->key < heap->min->key) in fibheap_insert()
115 heap->min = node; in fibheap_insert()
117 heap->nodes++; in fibheap_insert()
124 fibheap_min (fibheap_t heap) in fibheap_min() argument
127 if (heap->min == NULL) in fibheap_min()
[all …]
/netbsd-src/external/gpl3/gcc.old/dist/libiberty/
H A Dfibheap.c76 fibheap_compare (fibheap_t heap ATTRIBUTE_UNUSED, fibnode_t a, fibnode_t b) in fibheap_compare()
86 fibheap_comp_data (fibheap_t heap, fibheapkey_t key, void *data, fibnode_t b) in fibheap_comp_data() argument
93 return fibheap_compare (heap, &a, b); in fibheap_comp_data()
98 fibheap_insert (fibheap_t heap, fibheapkey_t key, void *data) in fibheap_insert() argument
110 fibheap_ins_root (heap, node); in fibheap_insert()
114 if (heap->min == NULL || node->key < heap->min->key) in fibheap_insert()
115 heap->min = node; in fibheap_insert()
117 heap->nodes++; in fibheap_insert()
124 fibheap_min (fibheap_t heap) in fibheap_min() argument
127 if (heap->min == NULL) in fibheap_min()
[all …]
/netbsd-src/external/gpl3/binutils/dist/libiberty/
H A Dfibheap.c76 fibheap_compare (fibheap_t heap ATTRIBUTE_UNUSED, fibnode_t a, fibnode_t b) in fibheap_compare()
86 fibheap_comp_data (fibheap_t heap, fibheapkey_t key, void *data, fibnode_t b) in fibheap_comp_data() argument
93 return fibheap_compare (heap, &a, b); in fibheap_comp_data()
98 fibheap_insert (fibheap_t heap, fibheapkey_t key, void *data) in fibheap_insert() argument
110 fibheap_ins_root (heap, node); in fibheap_insert()
114 if (heap->min == NULL || node->key < heap->min->key) in fibheap_insert()
115 heap->min = node; in fibheap_insert()
117 heap->nodes++; in fibheap_insert()
124 fibheap_min (fibheap_t heap) in fibheap_min() argument
127 if (heap->min == NULL) in fibheap_min()
[all …]
/netbsd-src/external/gpl2/libmalloc/dist/
H A Dralloc.c140 typedef struct heap struct
142 struct heap *next; argument
143 struct heap *prev; argument
159 #define HEAP_PTR_SIZE (sizeof (struct heap)) argument
164 static struct heap heap_base;
182 struct heap *heap; member
200 heap_ptr heap; local
202 for (heap = last_heap; heap; heap = heap->prev)
204 if (heap->start <= address && address <= heap->end)
205 return heap;
[all …]
/netbsd-src/external/mit/libuv/dist/src/
H A Dheap-inl.h40 struct heap { struct
50 HEAP_EXPORT(void heap_init(struct heap* heap)); argument
51 HEAP_EXPORT(struct heap_node* heap_min(const struct heap* heap));
52 HEAP_EXPORT(void heap_insert(struct heap* heap,
55 HEAP_EXPORT(void heap_remove(struct heap* heap,
58 HEAP_EXPORT(void heap_dequeue(struct heap* heap, heap_compare_fn less_than));
62 HEAP_EXPORT(void heap_init(struct heap* heap)) { in HEAP_EXPORT() argument
63 heap->min = NULL; in HEAP_EXPORT()
64 heap->nelts = 0; in HEAP_EXPORT()
67 HEAP_EXPORT(struct heap_node* heap_min(const struct heap* heap)) { in HEAP_EXPORT() argument
[all …]
/netbsd-src/external/gpl3/binutils/dist/gprofng/libcollector/
H A Dmemmgr.c95 __collector_mmgr_init_mutex_locks (Heap *heap) in __collector_mmgr_init_mutex_locks() argument
97 if (heap == NULL) in __collector_mmgr_init_mutex_locks()
99 if (__collector_mutex_trylock (&heap->lock)) in __collector_mmgr_init_mutex_locks()
107 __collector_mutex_init (&heap->lock); in __collector_mmgr_init_mutex_locks()
109 __collector_mutex_init (&heap->lock); in __collector_mmgr_init_mutex_locks()
159 Heap *heap; in __collector_newHeap() local
168 heap = (Heap*) chnk->hi; in __collector_newHeap()
169 heap->chain[0] = (void*) chnk; in __collector_newHeap()
170 __collector_mutex_init (&heap->lock); in __collector_newHeap()
171 return heap; in __collector_newHeap()
[all …]
H A Dmemmgr.h28 void __collector_deleteHeap (Heap *heap);
33 void __collector_mmgr_init_mutex_locks (Heap *heap);
38 void *__collector_allocCSize (Heap *heap, unsigned sz, int log);
43 void __collector_freeCSize (Heap *heap, void *ptr, unsigned sz);
48 void *__collector_allocVSize (Heap *heap, unsigned sz);
57 void *__collector_reallocVSize (Heap *heap, void *ptr, unsigned newsz);
/netbsd-src/external/gpl3/binutils.old/dist/gprofng/libcollector/
H A Dmemmgr.c95 __collector_mmgr_init_mutex_locks (Heap *heap) in __collector_mmgr_init_mutex_locks() argument
97 if (heap == NULL) in __collector_mmgr_init_mutex_locks()
99 if (__collector_mutex_trylock (&heap->lock)) in __collector_mmgr_init_mutex_locks()
107 __collector_mutex_init (&heap->lock); in __collector_mmgr_init_mutex_locks()
109 __collector_mutex_init (&heap->lock); in __collector_mmgr_init_mutex_locks()
159 Heap *heap; in __collector_newHeap() local
168 heap = (Heap*) chnk->hi; in __collector_newHeap()
169 heap->chain[0] = (void*) chnk; in __collector_newHeap()
170 __collector_mutex_init (&heap->lock); in __collector_newHeap()
171 return heap; in __collector_newHeap()
[all …]
H A Dmemmgr.h28 void __collector_deleteHeap (Heap *heap);
33 void __collector_mmgr_init_mutex_locks (Heap *heap);
38 void *__collector_allocCSize (Heap *heap, unsigned sz, int log);
43 void __collector_freeCSize (Heap *heap, void *ptr, unsigned sz);
48 void *__collector_allocVSize (Heap *heap, unsigned sz);
57 void *__collector_reallocVSize (Heap *heap, void *ptr, unsigned newsz);
/netbsd-src/sys/external/bsd/drm/dist/shared-core/
H A Di915_mem.c133 static struct mem_block *alloc_block(struct mem_block *heap, int size, in alloc_block() argument
139 for (p = heap->next; p != heap; p = p->next) { in alloc_block()
148 static struct mem_block *find_block(struct mem_block *heap, int start) in find_block() argument
152 for (p = heap->next; p != heap; p = p->next) in find_block()
185 static int init_heap(struct mem_block **heap, int start, int size) in init_heap() argument
192 *heap = drm_alloc(sizeof(**heap), DRM_MEM_BUFLISTS); in init_heap()
193 if (!*heap) { in init_heap()
201 blocks->next = blocks->prev = *heap; in init_heap()
203 memset(*heap, 0, sizeof(**heap)); in init_heap()
204 (*heap)->file_priv = (struct drm_file *) - 1; in init_heap()
[all …]
H A Dradeon_mem.c83 static struct mem_block *alloc_block(struct mem_block *heap, int size, in alloc_block() argument
89 list_for_each(p, heap) { in alloc_block()
98 static struct mem_block *find_block(struct mem_block *heap, int start) in find_block() argument
102 list_for_each(p, heap) in find_block()
135 static int init_heap(struct mem_block **heap, int start, int size) in init_heap() argument
142 *heap = drm_alloc(sizeof(**heap), DRM_MEM_BUFS); in init_heap()
143 if (!*heap) { in init_heap()
151 blocks->next = blocks->prev = *heap; in init_heap()
153 memset(*heap, 0, sizeof(**heap)); in init_heap()
154 (*heap)->file_priv = (struct drm_file *) - 1; in init_heap()
[all …]
/netbsd-src/external/gpl3/gcc/dist/gcc/
H A Dfibonacci_heap.cc119 int_heap_t *heap = build_simple_heap (values, nodes); in test_replace_key() local
123 heap->replace_key (nodes[i], 100 * 1000 + i); in test_replace_key()
125 ASSERT_EQ (TEST_HEAP_N, heap->nodes ()); in test_replace_key()
126 ASSERT_EQ (N, heap->min_key ()); in test_replace_key()
127 ASSERT_EQ (TEST_CALCULATE_VALUE (N), *heap->min ()); in test_replace_key()
130 heap->extract_min (); in test_replace_key()
132 ASSERT_EQ (1, heap->nodes ()); in test_replace_key()
133 ASSERT_EQ (100 * 1000 + N - 1, heap->min_key ()); in test_replace_key()
135 delete heap; in test_replace_key()
144 int_heap_t *heap = new int_heap_t (INT_MIN); in test_duplicate_keys() local
[all …]
/netbsd-src/external/gpl3/gcc.old/dist/gcc/
H A Dfibonacci_heap.c119 int_heap_t *heap = build_simple_heap (values, nodes); in test_replace_key() local
123 heap->replace_key (nodes[i], 100 * 1000 + i); in test_replace_key()
125 ASSERT_EQ (TEST_HEAP_N, heap->nodes ()); in test_replace_key()
126 ASSERT_EQ (N, heap->min_key ()); in test_replace_key()
127 ASSERT_EQ (TEST_CALCULATE_VALUE (N), *heap->min ()); in test_replace_key()
130 heap->extract_min (); in test_replace_key()
132 ASSERT_EQ (1, heap->nodes ()); in test_replace_key()
133 ASSERT_EQ (100 * 1000 + N - 1, heap->min_key ()); in test_replace_key()
135 delete heap; in test_replace_key() local
144 int_heap_t *heap = new int_heap_t (INT_MIN); in test_duplicate_keys() local
[all …]
/netbsd-src/external/bsd/libbind/dist/isc/
H A Dheap.c72 ctx->heap = NULL; in heap_new()
85 if (ctx->heap != NULL) in heap_free()
86 free(ctx->heap); in heap_free()
97 new_heap = (void **)realloc(ctx->heap, in heap_resize()
103 ctx->heap = new_heap; in heap_resize()
112 i > 1 && ctx->higher_priority(elt, ctx->heap[p]); in float_up()
114 ctx->heap[i] = ctx->heap[p]; in float_up()
116 (ctx->index)(ctx->heap[i], i); in float_up()
118 ctx->heap[i] = elt; in float_up()
120 (ctx->index)(ctx->heap[i], i); in float_up()
[all …]
/netbsd-src/external/bsd/libevent/dist/test/
H A Dregress_minheap.c45 check_heap(struct min_heap *heap) in check_heap() argument
48 for (i = 1; i < heap->n; ++i) { in check_heap()
50 tt_want(evutil_timercmp(&heap->p[i]->ev_timeout, in check_heap()
51 &heap->p[parent_idx]->ev_timeout, >=)); in check_heap()
58 struct min_heap heap; in test_heap_randomized() local
63 min_heap_ctor_(&heap); in test_heap_randomized()
68 min_heap_push_(&heap, inserted[i]); in test_heap_randomized()
70 check_heap(&heap); in test_heap_randomized()
72 tt_assert(min_heap_size_(&heap) == 1024); in test_heap_randomized()
75 min_heap_erase_(&heap, inserted[i]); in test_heap_randomized()
[all …]
/netbsd-src/external/bsd/bzip2/dist/
H A Dhuffman.c38 zz = z; tmp = heap[zz]; \
39 while (weight[tmp] < weight[heap[zz >> 1]]) { \
40 heap[zz] = heap[zz >> 1]; \
43 heap[zz] = tmp; \
49 zz = z; tmp = heap[zz]; \
54 weight[heap[yy+1]] < weight[heap[yy]]) \
56 if (weight[tmp] < weight[heap[yy]]) break; \
57 heap[zz] = heap[yy]; \
60 heap[zz] = tmp; \
77 Int32 heap [ BZ_MAX_ALPHA_SIZE + 2 ]; in BZ2_hbMakeCodeLengths() local
[all …]
/netbsd-src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/mmu/
H A Dnouveau_nvkm_subdev_mmu_base.c265 nvkm_mmu_type(struct nvkm_mmu *mmu, int heap, u8 type) in nvkm_mmu_type() argument
267 if (heap >= 0 && !WARN_ON(mmu->type_nr == ARRAY_SIZE(mmu->type))) { in nvkm_mmu_type()
268 mmu->type[mmu->type_nr].type = type | mmu->heap[heap].type; in nvkm_mmu_type()
269 mmu->type[mmu->type_nr].heap = heap; in nvkm_mmu_type()
278 if (!WARN_ON(mmu->heap_nr == ARRAY_SIZE(mmu->heap))) { in nvkm_mmu_heap()
279 mmu->heap[mmu->heap_nr].type = type; in nvkm_mmu_heap()
280 mmu->heap[mmu->heap_nr].size = size; in nvkm_mmu_heap()
292 int heap; in nvkm_mmu_host() local
295 heap = nvkm_mmu_heap(mmu, NVKM_MEM_HOST, ~0ULL); in nvkm_mmu_host()
296 nvkm_mmu_type(mmu, heap, type); in nvkm_mmu_host()
[all …]
/netbsd-src/crypto/external/bsd/openssl.old/dist/doc/man3/
H A DOPENSSL_secure_malloc.pod11 CRYPTO_secure_used - secure heap storage
45 information might be stored, OpenSSL supports the concept of a "secure heap."
50 If a secure heap is used, then private key B<BIGNUM> values are stored there.
54 CRYPTO_secure_malloc_init() creates the secure heap, with the specified
56 allocate from the heap. Both C<size> and C<minsize> must be a power
60 heap as been initialized and is available.
62 CRYPTO_secure_malloc_done() releases the heap and makes the memory unavailable
66 OPENSSL_secure_malloc() allocates C<num> bytes from the heap.
76 OPENSSL_secure_free() releases the memory at C<ptr> back to the heap.
87 the memory if it was not allocated from the secure heap.
[all …]
/netbsd-src/external/mpl/bind/dist/tests/isc/
H A Dheap_test.c29 #include <isc/heap.h>
57 isc_heap_t *heap = NULL; in ISC_RUN_TEST_IMPL() local
62 isc_heap_create(mctx, compare, idx, 0, &heap); in ISC_RUN_TEST_IMPL()
63 assert_non_null(heap); in ISC_RUN_TEST_IMPL()
65 isc_heap_insert(heap, &e1); in ISC_RUN_TEST_IMPL()
68 isc_heap_delete(heap, e1.index); in ISC_RUN_TEST_IMPL()
71 isc_heap_destroy(&heap); in ISC_RUN_TEST_IMPL()
72 assert_null(heap); in ISC_RUN_TEST_IMPL()
/netbsd-src/external/mpl/dhcp/dist/includes/
H A Dheap.h90 isc_heap_insert(isc_heap_t *heap, void *elt);
99 isc_heap_delete(isc_heap_t *heap, unsigned int index);
110 isc_heap_increased(isc_heap_t *heap, unsigned int index);
122 isc_heap_decreased(isc_heap_t *heap, unsigned int index);
134 isc_heap_element(isc_heap_t *heap, unsigned int index);
148 isc_heap_foreach(isc_heap_t *heap, isc_heapaction_t action, void *uap);
/netbsd-src/external/mpl/bind/dist/lib/isc/include/isc/
H A Dheap.h1 /* $NetBSD: heap.h,v 1.8 2025/01/26 16:25:41 christos Exp $ */
18 /*! \file isc/heap.h */
34 * The index function allows the client of the heap to receive a callback
37 * from the heap require the index be provided.
42 * The heapaction function is used when iterating over the heap.
44 * NOTE: The heap structure CANNOT BE MODIFIED during the call to
56 * \brief Create a new heap. The heap is implemented using a space-efficient
57 * storage method. When the heap elements are deleted space is not freed
70 * heap
[all...]
/netbsd-src/external/mpl/dhcp/bind/dist/lib/isc/include/isc/
H A Dheap.h89 isc_heap_insert(isc_heap_t *heap, void *elt);
98 isc_heap_delete(isc_heap_t *heap, unsigned int index);
109 isc_heap_increased(isc_heap_t *heap, unsigned int index);
121 isc_heap_decreased(isc_heap_t *heap, unsigned int index);
133 isc_heap_element(isc_heap_t *heap, unsigned int index);
147 isc_heap_foreach(isc_heap_t *heap, isc_heapaction_t action, void *uap);

12345678910>>...22