Home
last modified time | relevance | path

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

12345678910>>...33

/external/libchrome/base/task/sequence_manager/
Dintrusive_heap_unittest.cc42 IntrusiveHeap<TestElement> heap; in TEST_F() local
44 EXPECT_TRUE(heap.empty()); in TEST_F()
45 EXPECT_EQ(0u, heap.size()); in TEST_F()
49 IntrusiveHeap<TestElement> heap; in TEST_F() local
52 heap.insert({11, &index1}); in TEST_F()
53 EXPECT_EQ(1u, heap.size()); in TEST_F()
56 heap.Clear(); in TEST_F()
57 EXPECT_EQ(0u, heap.size()); in TEST_F()
65 IntrusiveHeap<TestElement> heap; in TEST_F() local
67 heap.insert({11, &index1}); in TEST_F()
[all …]
/external/grpc-grpc/src/core/lib/iomgr/
Dtimer_heap.cc73 static void maybe_shrink(grpc_timer_heap* heap) { in maybe_shrink() argument
74 if (heap->timer_count >= 8 && in maybe_shrink()
75 heap->timer_count <= heap->timer_capacity / SHRINK_FULLNESS_FACTOR / 2) { in maybe_shrink()
76 heap->timer_capacity = heap->timer_count * SHRINK_FULLNESS_FACTOR; in maybe_shrink()
77 heap->timers = static_cast<grpc_timer**>( in maybe_shrink()
78 gpr_realloc(heap->timers, heap->timer_capacity * sizeof(grpc_timer*))); in maybe_shrink()
82 static void note_changed_priority(grpc_timer_heap* heap, grpc_timer* timer) { in note_changed_priority() argument
85 if (heap->timers[parent]->deadline > timer->deadline) { in note_changed_priority()
86 adjust_upwards(heap->timers, i, timer); in note_changed_priority()
88 adjust_downwards(heap->timers, i, heap->timer_count, timer); in note_changed_priority()
[all …]
/external/rust/crates/grpcio-sys/grpc/src/core/lib/iomgr/
Dtimer_heap.cc73 static void maybe_shrink(grpc_timer_heap* heap) { in maybe_shrink() argument
74 if (heap->timer_count >= 8 && in maybe_shrink()
75 heap->timer_count <= heap->timer_capacity / SHRINK_FULLNESS_FACTOR / 2) { in maybe_shrink()
76 heap->timer_capacity = heap->timer_count * SHRINK_FULLNESS_FACTOR; in maybe_shrink()
77 heap->timers = static_cast<grpc_timer**>( in maybe_shrink()
78 gpr_realloc(heap->timers, heap->timer_capacity * sizeof(grpc_timer*))); in maybe_shrink()
82 static void note_changed_priority(grpc_timer_heap* heap, grpc_timer* timer) { in note_changed_priority() argument
85 if (heap->timers[parent]->deadline > timer->deadline) { in note_changed_priority()
86 adjust_upwards(heap->timers, i, timer); in note_changed_priority()
88 adjust_downwards(heap->timers, i, heap->timer_count, timer); in note_changed_priority()
[all …]
/external/python/cpython2/Modules/
D_heapqmodule.c36 _siftdown(PyListObject *heap, Py_ssize_t startpos, Py_ssize_t pos) in _siftdown() argument
42 assert(PyList_Check(heap)); in _siftdown()
43 size = PyList_GET_SIZE(heap); in _siftdown()
51 newitem = PyList_GET_ITEM(heap, pos); in _siftdown()
54 parent = PyList_GET_ITEM(heap, parentpos); in _siftdown()
58 if (size != PyList_GET_SIZE(heap)) { in _siftdown()
65 parent = PyList_GET_ITEM(heap, parentpos); in _siftdown()
66 newitem = PyList_GET_ITEM(heap, pos); in _siftdown()
67 PyList_SET_ITEM(heap, parentpos, newitem); in _siftdown()
68 PyList_SET_ITEM(heap, pos, parent); in _siftdown()
[all …]
/external/llvm-project/compiler-rt/test/tsan/
Djava_finalizer2.cpp20 Heap* heap = (Heap*)p; in Thread1() local
21 pthread_barrier_wait(&heap->barrier_finalizer); in Thread1()
23 __atomic_fetch_add(&heap->wg, 1, __ATOMIC_RELEASE); in Thread1()
24 __atomic_store_n(&heap->finalized, 1, __ATOMIC_RELAXED); in Thread1()
29 Heap* heap = (Heap*)p; in Thread2() local
30 pthread_barrier_wait(&heap->barrier_finalizer); in Thread2()
31 heap->data = 1; in Thread2()
32 __atomic_store_n(&heap->ready, 1, __ATOMIC_RELEASE); in Thread2()
37 Heap* heap = (Heap*)p; in Thread3() local
38 pthread_barrier_wait(&heap->barrier_finalizer); in Thread3()
[all …]
/external/python/cpython3/Modules/
D_heapqmodule.c19 siftdown(PyListObject *heap, Py_ssize_t startpos, Py_ssize_t pos) in siftdown() argument
25 assert(PyList_Check(heap)); in siftdown()
26 size = PyList_GET_SIZE(heap); in siftdown()
34 arr = _PyList_ITEMS(heap); in siftdown()
46 if (size != PyList_GET_SIZE(heap)) { in siftdown()
53 arr = _PyList_ITEMS(heap); in siftdown()
64 siftup(PyListObject *heap, Py_ssize_t pos) in siftup() argument
70 assert(PyList_Check(heap)); in siftup()
71 endpos = PyList_GET_SIZE(heap); in siftup()
79 arr = _PyList_ITEMS(heap); in siftup()
[all …]
/external/python/cpython2/Lib/
Dheapq.py140 def heappush(heap, item): argument
142 heap.append(item)
143 _siftdown(heap, 0, len(heap)-1)
145 def heappop(heap): argument
147 lastelt = heap.pop() # raises appropriate IndexError if heap is empty
148 if heap:
149 returnitem = heap[0]
150 heap[0] = lastelt
151 _siftup(heap, 0)
156 def heapreplace(heap, item): argument
[all …]
/external/python/cpython3/Lib/
Dheapq.py130 def heappush(heap, item): argument
132 heap.append(item)
133 _siftdown(heap, 0, len(heap)-1)
135 def heappop(heap): argument
137 lastelt = heap.pop() # raises appropriate IndexError if heap is empty
138 if heap:
139 returnitem = heap[0]
140 heap[0] = lastelt
141 _siftup(heap, 0)
145 def heapreplace(heap, item): argument
[all …]
/external/skia/tests/
DTDPQueueTest.cpp15 SkTDPQueue<int, intless> heap; in simple_test() local
16 REPORTER_ASSERT(reporter, 0 == heap.count()); in simple_test()
18 heap.insert(0); in simple_test()
19 REPORTER_ASSERT(reporter, 1 == heap.count()); in simple_test()
20 REPORTER_ASSERT(reporter, 0 == heap.peek()); in simple_test()
21 heap.pop(); in simple_test()
22 REPORTER_ASSERT(reporter, 0 == heap.count()); in simple_test()
24 heap.insert(0); in simple_test()
25 heap.insert(1); in simple_test()
26 REPORTER_ASSERT(reporter, 2 == heap.count()); in simple_test()
[all …]
/external/skqp/tests/
DTDPQueueTest.cpp15 SkTDPQueue<int, intless> heap; in simple_test() local
16 REPORTER_ASSERT(reporter, 0 == heap.count()); in simple_test()
18 heap.insert(0); in simple_test()
19 REPORTER_ASSERT(reporter, 1 == heap.count()); in simple_test()
20 REPORTER_ASSERT(reporter, 0 == heap.peek()); in simple_test()
21 heap.pop(); in simple_test()
22 REPORTER_ASSERT(reporter, 0 == heap.count()); in simple_test()
24 heap.insert(0); in simple_test()
25 heap.insert(1); in simple_test()
26 REPORTER_ASSERT(reporter, 2 == heap.count()); in simple_test()
[all …]
/external/jemalloc_new/test/unit/
Dph.c65 heap_print(const heap_t *heap) { in heap_print() argument
68 malloc_printf("vvv heap %p vvv\n", heap); in heap_print()
69 if (heap->ph_root == NULL) { in heap_print()
73 node_print(heap->ph_root, 0); in heap_print()
75 for (auxelm = phn_next_get(node_t, link, heap->ph_root); auxelm != NULL; in heap_print()
84 malloc_printf("^^^ heap %p ^^^\n", heap); in heap_print()
116 heap_validate(const heap_t *heap) { in heap_validate() argument
120 if (heap->ph_root == NULL) { in heap_validate()
124 nnodes += node_validate(heap->ph_root, NULL); in heap_validate()
126 for (auxelm = phn_next_get(node_t, link, heap->ph_root); auxelm != NULL; in heap_validate()
[all …]
/external/mesa3d/src/util/
Du_mm.c34 u_mmDumpMemInfo(const struct mem_block *heap) in u_mmDumpMemInfo() argument
36 debug_printf("Memory heap %p:\n", (void *) heap); in u_mmDumpMemInfo()
37 if (heap == NULL) { in u_mmDumpMemInfo()
44 for (p = heap->next; p != heap; p = p->next) { in u_mmDumpMemInfo()
58 for (p = heap->next_free; p != heap; p = p->next_free) { in u_mmDumpMemInfo()
72 struct mem_block *heap, *block; in u_mmInit() local
77 heap = CALLOC_STRUCT(mem_block); in u_mmInit()
78 if (!heap) in u_mmInit()
83 FREE(heap); in u_mmInit()
87 heap->next = block; in u_mmInit()
[all …]
Dvma.c46 util_vma_heap_init(struct util_vma_heap *heap, in util_vma_heap_init() argument
49 list_inithead(&heap->holes); in util_vma_heap_init()
50 util_vma_heap_free(heap, start, size); in util_vma_heap_init()
53 heap->alloc_high = true; in util_vma_heap_init()
57 util_vma_heap_finish(struct util_vma_heap *heap) in util_vma_heap_finish() argument
59 util_vma_foreach_hole_safe(hole, heap) in util_vma_heap_finish()
65 util_vma_heap_validate(struct util_vma_heap *heap) in util_vma_heap_validate() argument
68 util_vma_foreach_hole(hole, heap) { in util_vma_heap_validate()
72 if (&hole->link == heap->holes.next) { in util_vma_heap_validate()
91 #define util_vma_heap_validate(heap) argument
[all …]
/external/libdrm/intel/
Dmm.c32 drm_private void mmDumpMemInfo(const struct mem_block *heap) in mmDumpMemInfo() argument
34 drmMsg("Memory heap %p:\n", (void *)heap); in mmDumpMemInfo()
35 if (heap == 0) { in mmDumpMemInfo()
40 for (p = heap->next; p != heap; p = p->next) { in mmDumpMemInfo()
48 for (p = heap->next_free; p != heap; p = p->next_free) { in mmDumpMemInfo()
60 struct mem_block *heap, *block; in mmInit() local
65 heap = (struct mem_block *)calloc(1, sizeof(struct mem_block)); in mmInit()
66 if (!heap) in mmInit()
71 free(heap); in mmInit()
75 heap->next = block; in mmInit()
[all …]
/external/deqp/framework/delibs/depool/
DdePoolHeap.c62 TestHeap* heap = TestHeap_create(pool); in dePoolHeap_selfTest() local
65 TestHeap_push(heap, HeapItem_create(10, 10)); in dePoolHeap_selfTest()
66 TestHeap_push(heap, HeapItem_create(0, 10)); in dePoolHeap_selfTest()
67 TestHeap_push(heap, HeapItem_create(20, 10)); in dePoolHeap_selfTest()
68 DE_TEST_ASSERT(TestHeap_getNumElements(heap) == 3); in dePoolHeap_selfTest()
70 DE_TEST_ASSERT(TestHeap_popMin(heap).priority == 0); in dePoolHeap_selfTest()
71 DE_TEST_ASSERT(TestHeap_popMin(heap).priority == 10); in dePoolHeap_selfTest()
72 DE_TEST_ASSERT(TestHeap_popMin(heap).priority == 20); in dePoolHeap_selfTest()
73 DE_TEST_ASSERT(TestHeap_getNumElements(heap) == 0); in dePoolHeap_selfTest()
80 TestHeap_push(heap, HeapItem_create(i, -i)); in dePoolHeap_selfTest()
[all …]
DdePoolHeap.h67 DE_INLINE int TYPENAME##_getNumElements (const TYPENAME* heap) DE_UNUSED_FUNCTION; \
68 DE_INLINE deBool TYPENAME##_reserve (DE_PTR_TYPE(TYPENAME) heap, int capacity) DE_UNUSED_FUNCTIO…
69 DE_INLINE void TYPENAME##_reset (DE_PTR_TYPE(TYPENAME) heap) DE_UNUSED_FUNCTION; \
70 DE_INLINE void TYPENAME##_moveDown (DE_PTR_TYPE(TYPENAME) heap, int ndx) DE_UNUSED_FUNCTION; \
71 DE_INLINE void TYPENAME##_moveUp (DE_PTR_TYPE(TYPENAME) heap, int ndx) DE_UNUSED_FUNCTION; \
72 DE_INLINE deBool TYPENAME##_push (DE_PTR_TYPE(TYPENAME) heap, VALUETYPE elem) DE_UNUSED_FUNCTION…
73 DE_INLINE VALUETYPE TYPENAME##_popMin (DE_PTR_TYPE(TYPENAME) heap) DE_UNUSED_FUNCTION; \
77 DE_PTR_TYPE(TYPENAME) heap = DE_POOL_NEW(pool, TYPENAME); \
78 if (!heap) \
80 heap->array = TYPENAME##Array_create(pool); \
[all …]
/external/mesa3d/src/gallium/drivers/nouveau/
Dnouveau_heap.c29 nouveau_heap_init(struct nouveau_heap **heap, in nouveau_heap_init() argument
40 *heap = r; in nouveau_heap_init()
45 nouveau_heap_destroy(struct nouveau_heap **heap) in nouveau_heap_destroy() argument
47 if (!*heap) in nouveau_heap_destroy()
49 free(*heap); in nouveau_heap_destroy()
50 *heap = NULL; in nouveau_heap_destroy()
54 nouveau_heap_alloc(struct nouveau_heap *heap, unsigned size, void *priv, in nouveau_heap_alloc() argument
59 if (!heap || !size || !res || *res) in nouveau_heap_alloc()
62 while (heap) { in nouveau_heap_alloc()
63 if (!heap->in_use && heap->size >= size) { in nouveau_heap_alloc()
[all …]
/external/libevent/test/
Dregress_minheap.c44 check_heap(struct min_heap *heap) in check_heap() argument
47 for (i = 1; i < heap->n; ++i) { in check_heap()
49 tt_want(evutil_timercmp(&heap->p[i]->ev_timeout, in check_heap()
50 &heap->p[parent_idx]->ev_timeout, >=)); in check_heap()
57 struct min_heap heap; in test_heap_randomized() local
62 min_heap_ctor_(&heap); in test_heap_randomized()
67 min_heap_push_(&heap, inserted[i]); in test_heap_randomized()
69 check_heap(&heap); in test_heap_randomized()
71 tt_assert(min_heap_size_(&heap) == 1024); in test_heap_randomized()
74 min_heap_erase_(&heap, inserted[i]); in test_heap_randomized()
[all …]
/external/bzip2/
Dhuffman.c36 zz = z; tmp = heap[zz]; \
37 while (weight[tmp] < weight[heap[zz >> 1]]) { \
38 heap[zz] = heap[zz >> 1]; \
41 heap[zz] = tmp; \
47 zz = z; tmp = heap[zz]; \
52 weight[heap[yy+1]] < weight[heap[yy]]) \
54 if (weight[tmp] < weight[heap[yy]]) break; \
55 heap[zz] = heap[yy]; \
58 heap[zz] = tmp; \
75 Int32 heap [ BZ_MAX_ALPHA_SIZE + 2 ]; in BZ2_hbMakeCodeLengths() local
[all …]
/external/python/cpython2/Lib/test/
Dtest_heapq.py33 heap = []
35 self.check_invariant(heap)
39 self.module.heappush(heap, item)
40 self.check_invariant(heap)
42 while heap:
43 item = self.module.heappop(heap)
44 self.check_invariant(heap)
59 def check_invariant(self, heap): argument
61 for pos, item in enumerate(heap):
64 self.assertTrue(heap[parentpos] <= item)
[all …]
/external/python/cpython3/Modules/clinic/
D_heapqmodule.c.h15 _heapq_heappush_impl(PyObject *module, PyObject *heap, PyObject *item);
21 PyObject *heap; in _heapq_heappush() local
27 heap = args[0]; in _heapq_heappush()
29 return_value = _heapq_heappush_impl(module, heap, item); in _heapq_heappush()
62 _heapq_heapreplace_impl(PyObject *module, PyObject *heap, PyObject *item);
68 PyObject *heap; in _heapq_heapreplace() local
74 heap = args[0]; in _heapq_heapreplace()
76 return_value = _heapq_heapreplace_impl(module, heap, item); in _heapq_heapreplace()
95 _heapq_heappushpop_impl(PyObject *module, PyObject *heap, PyObject *item);
101 PyObject *heap; in _heapq_heappushpop() local
[all …]
/external/python/cpython3/Lib/test/
Dtest_heapq.py51 heap = []
53 self.check_invariant(heap)
57 self.module.heappush(heap, item)
58 self.check_invariant(heap)
60 while heap:
61 item = self.module.heappop(heap)
62 self.check_invariant(heap)
77 def check_invariant(self, heap): argument
79 for pos, item in enumerate(heap):
82 self.assertTrue(heap[parentpos] <= item)
[all …]
/external/rust/crates/itertools/src/
Dkmerge_impl.rs71 fn sift_down<T, S>(heap: &mut [T], index: usize, mut less_than: S) in sift_down()
74 debug_assert!(index <= heap.len()); in sift_down()
78 while pos < heap.len() && child < heap.len() { in sift_down()
82 if right < heap.len() && less_than(&heap[right], &heap[child]) { in sift_down()
87 if !less_than(&heap[child], &heap[pos]) { in sift_down()
90 heap.swap(pos, child); in sift_down()
155 heap: Vec<HeadTail<I>>, field
163 debug_fmt_fields!(KMergeBy, heap);
177 let mut heap: Vec<_> = Vec::with_capacity(lower); in kmerge_by() localVariable
178 heap.extend(iter.filter_map(|it| HeadTail::new(it.into_iter()))); in kmerge_by()
[all …]
/external/skia/src/gpu/d3d/
DGrD3DDescriptorTableManager.cpp45 void GrD3DDescriptorTableManager::recycle(Heap* heap) { in recycle() argument
47 sk_sp<Heap> wrappedHeap(heap); in recycle()
49 SkASSERT(heap); in recycle()
50 switch (heap->type()) { in recycle()
66 std::unique_ptr<GrD3DDescriptorHeap> heap = in Make() local
69 if (!heap) { in Make()
73 return sk_sp< GrD3DDescriptorTableManager::Heap>(new Heap(gpu, heap, type, descriptorCount)); in Make()
95 sk_sp<Heap> heap = Heap::Make(gpu, fHeapType, fCurrentHeapDescriptorCount); in HeapPool() local
96 fDescriptorHeaps.push_back(heap); in HeapPool()
115 sk_sp<GrD3DDescriptorTableManager::Heap> heap = in allocateTable() local
[all …]
/external/perfetto/src/profiling/memory/
Dparse_smaps_unittest.cc56 SmapsEntry heap; in TEST() local
57 heap.pathname = "[heap stuff]"; in TEST()
58 heap.size_kb = 132; in TEST()
59 heap.private_dirty_kb = 8; in TEST()
60 heap.swap_kb = 4; in TEST()
61 EXPECT_THAT(entries, ElementsAre(cat1, cat2, heap)); in TEST()
83 SmapsEntry heap; in TEST() local
84 heap.pathname = "[heap stuff]"; in TEST()
85 heap.size_kb = 132; in TEST()
86 heap.private_dirty_kb = 8; in TEST()
[all …]

12345678910>>...33