/external/libchrome/base/task/sequence_manager/ |
D | intrusive_heap_unittest.cc | 42 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/ |
D | timer_heap.cc | 73 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.c | 36 _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/python/cpython3/Modules/ |
D | _heapqmodule.c | 12 siftdown(PyListObject *heap, Py_ssize_t startpos, Py_ssize_t pos) in siftdown() argument 18 assert(PyList_Check(heap)); in siftdown() 19 size = PyList_GET_SIZE(heap); in siftdown() 27 arr = _PyList_ITEMS(heap); in siftdown() 35 if (size != PyList_GET_SIZE(heap)) { in siftdown() 42 arr = _PyList_ITEMS(heap); in siftdown() 53 siftup(PyListObject *heap, Py_ssize_t pos) in siftup() argument 59 assert(PyList_Check(heap)); in siftup() 60 endpos = PyList_GET_SIZE(heap); in siftup() 68 arr = _PyList_ITEMS(heap); in siftup() [all …]
|
/external/python/cpython2/Lib/ |
D | heapq.py | 140 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/ |
D | heapq.py | 130 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/ |
D | TDPQueueTest.cpp | 15 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/ |
D | TDPQueueTest.cpp | 15 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/ |
D | ph.c | 65 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/mesa/main/ |
D | mm.c | 33 mmDumpMemInfo(const struct mem_block *heap) in mmDumpMemInfo() argument 35 fprintf(stderr, "Memory heap %p:\n", (void *)heap); in mmDumpMemInfo() 36 if (heap == 0) { in mmDumpMemInfo() 41 for(p = heap->next; p != heap; p = p->next) { in mmDumpMemInfo() 49 for(p = heap->next_free; p != heap; p = p->next_free) { in mmDumpMemInfo() 62 struct mem_block *heap, *block; in mmInit() local 67 heap = calloc(1, sizeof(struct mem_block)); in mmInit() 68 if (!heap) in mmInit() 73 free(heap); in mmInit() 77 heap->next = block; in mmInit() [all …]
|
/external/mesa3d/src/gallium/auxiliary/util/ |
D | u_mm.c | 34 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 …]
|
/external/libdrm/intel/ |
D | mm.c | 32 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/jemalloc/test/unit/ |
D | ph.c | 63 heap_print(const heap_t *heap) in heap_print() argument 67 malloc_printf("vvv heap %p vvv\n", heap); in heap_print() 68 if (heap->ph_root == NULL) in heap_print() 71 node_print(heap->ph_root, 0); in heap_print() 73 for (auxelm = phn_next_get(node_t, link, heap->ph_root); auxelm != NULL; in heap_print() 82 malloc_printf("^^^ heap %p ^^^\n", heap); in heap_print() 114 heap_validate(const heap_t *heap) in heap_validate() argument 119 if (heap->ph_root == NULL) in heap_validate() 122 nnodes += node_validate(heap->ph_root, NULL); in heap_validate() 124 for (auxelm = phn_next_get(node_t, link, heap->ph_root); auxelm != NULL; in heap_validate() [all …]
|
/external/v8/src/heap/ |
D | incremental-marking-job.cc | 18 void IncrementalMarkingJob::Start(Heap* heap) { in Start() argument 19 DCHECK(!heap->incremental_marking()->IsStopped()); in Start() 20 ScheduleTask(heap); in Start() 23 void IncrementalMarkingJob::ScheduleTask(Heap* heap) { in ScheduleTask() argument 24 if (!task_pending_ && !heap->IsTearingDown()) { in ScheduleTask() 25 v8::Isolate* isolate = reinterpret_cast<v8::Isolate*>(heap->isolate()); in ScheduleTask() 27 auto task = new Task(heap->isolate(), this); in ScheduleTask() 32 void IncrementalMarkingJob::Task::Step(Heap* heap) { in Step() argument 35 heap->MonotonicallyIncreasingTimeInMs() + kIncrementalMarkingDelayMs; in Step() 36 heap->incremental_marking()->AdvanceIncrementalMarking( in Step() [all …]
|
D | objects-visiting.cc | 18 static bool MustRecordSlots(Heap* heap) { in MustRecordSlots() argument 19 return heap->gc_state() == Heap::MARK_COMPACT && in MustRecordSlots() 20 heap->mark_compact_collector()->is_compacting(); in MustRecordSlots() 29 Object* VisitWeakList(Heap* heap, Object* list, WeakObjectRetainer* retainer) { in VisitWeakList() argument 30 Object* undefined = ReadOnlyRoots(heap).undefined_value(); in VisitWeakList() 33 bool record_slots = MustRecordSlots(heap); in VisitWeakList() 61 DCHECK(!retained->IsUndefined(heap->isolate())); in VisitWeakList() 66 WeakListVisitor<T>::VisitLiveObject(heap, tail, retainer); in VisitWeakList() 69 WeakListVisitor<T>::VisitPhantomObject(heap, candidate); in VisitWeakList() 80 static void ClearWeakList(Heap* heap, Object* list) { in ClearWeakList() argument [all …]
|
D | memory-reducer.cc | 23 MemoryReducer::MemoryReducer(Heap* heap) in MemoryReducer() argument 24 : heap_(heap), in MemoryReducer() 26 reinterpret_cast<v8::Isolate*>(heap->isolate()))), in MemoryReducer() 32 : CancelableTask(memory_reducer->heap()->isolate()), in TimerTask() 37 Heap* heap = memory_reducer_->heap(); in RunInternal() local 39 double time_ms = heap->MonotonicallyIncreasingTimeInMs(); in RunInternal() 40 heap->tracer()->SampleAllocation(time_ms, heap->NewSpaceAllocationCounter(), in RunInternal() 41 heap->OldGenerationAllocationCounter()); in RunInternal() 42 bool low_allocation_rate = heap->HasLowAllocationRate(); in RunInternal() 43 bool optimize_for_memory = heap->ShouldOptimizeForMemoryUsage(); in RunInternal() [all …]
|
D | scavenge-job.cc | 24 Heap* heap = isolate()->heap(); in RunInternal() local 28 double start_ms = heap->MonotonicallyIncreasingTimeInMs(); in RunInternal() 31 heap->tracer()->ScavengeSpeedInBytesPerMillisecond(); in RunInternal() 32 size_t new_space_size = heap->new_space()->Size(); in RunInternal() 33 size_t new_space_capacity = heap->new_space()->Capacity(); in RunInternal() 41 heap->CollectGarbage(NEW_SPACE, GarbageCollectionReason::kIdleTask); in RunInternal() 44 job_->RescheduleIdleTask(heap); in RunInternal() 84 void ScavengeJob::RescheduleIdleTask(Heap* heap) { in RescheduleIdleTask() argument 88 ScheduleIdleTask(heap); in RescheduleIdleTask() 94 void ScavengeJob::ScheduleIdleTaskIfNeeded(Heap* heap, int bytes_allocated) { in ScheduleIdleTaskIfNeeded() argument [all …]
|
/external/deqp/framework/delibs/depool/ |
D | dePoolHeap.h | 67 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 …]
|
D | dePoolHeap.c | 62 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 …]
|
/external/mesa3d/src/gallium/drivers/nouveau/ |
D | nouveau_heap.c | 29 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/tensorflow/tensorflow/compiler/xla/service/ |
D | heap_simulator_test.cc | 816 NoFragmentationStatsHeap heap; in TEST_F() local 817 EXPECT_EQ(0, heap.Finish().heap_size); in TEST_F() 821 NoFragmentationStatsHeap heap; in TEST_F() local 822 heap.Alloc(buffer_a_, 10); in TEST_F() 823 heap.Alloc(buffer_b_, 20); in TEST_F() 824 heap.Alloc(buffer_c_, 30); in TEST_F() 825 heap.Alloc(buffer_d_, 30); in TEST_F() 826 heap.Free(buffer_a_, 10); in TEST_F() 827 heap.Free(buffer_b_, 20); in TEST_F() 828 heap.Free(buffer_c_, 30); in TEST_F() [all …]
|
/external/libevent/test/ |
D | regress_minheap.c | 44 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/python/cpython2/Lib/test/ |
D | test_heapq.py | 33 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/Lib/test/ |
D | test_heapq.py | 33 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/bzip2/ |
D | huffman.c | 36 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 …]
|