Lines Matching defs:heaps
135 /* The heaps; heaps[0] is always the active heap,
138 Heap heaps[HEAP_SOURCE_MAX_HEAP_COUNT];
140 /* The current number of heaps.
179 #define hs2heap(hs_) (&((hs_)->heaps[0]))
209 * Returns the current footprint of all heaps. If includeActive
224 footprint += mspace_footprint(hs->heaps[i].msp);
239 const Heap *const heap = &hs->heaps[i];
331 hs->heaps[0].msp = msp;
332 hs->heaps[0].maximumSize = maximumSize;
333 hs->heaps[0].concurrentStartBytes = SIZE_MAX;
334 hs->heaps[0].base = hs->heapBase;
335 hs->heaps[0].limit = hs->heapBase + hs->heaps[0].maximumSize;
342 * are too many heaps or insufficient free space to add another heap.
350 LOGE("Attempt to create too many heaps (%zd >= %zd)",
362 void *sbrk0 = contiguous_mspace_sbrk0(hs->heaps[0].msp);
364 size_t overhead = base - hs->heaps[0].base;
365 assert(((size_t)hs->heaps[0].base & (SYSTEM_PAGE_SIZE - 1)) == 0);
368 LOGE_HEAP("No room to create any more heaps "
385 hs->heaps[0].maximumSize = overhead;
386 hs->heaps[0].limit = base;
387 mspace msp = hs->heaps[0].msp;
390 /* Put the new heap in the list, at heaps[0].
391 * Shift existing heaps down.
393 memmove(&hs->heaps[1], &hs->heaps[0], hs->numHeaps * sizeof(hs->heaps[0]));
394 hs->heaps[0] = heap;
402 * when signaled. Also periodically trims the heaps when a few seconds
522 * among the heaps managed by the garbage collector.
678 Heap *const heap = &hs->heaps[i];
713 base[i] = (uintptr_t)hs->heaps[i].base;
714 max[i] = MIN((uintptr_t)hs->heaps[i].limit - 1, hs->markBits.max);
759 assert(immuneLimit == gHs->heaps[0].base ||
764 assert(gHs->heaps[0].base >= immuneLimit);
765 assert(gHs->heaps[0].limit > immuneLimit);
768 if (gHs->heaps[i].base < immuneLimit) {
769 assert(gHs->heaps[i].limit <= immuneLimit);
772 (uintptr_t)gHs->heaps[i].base - gHs->liveBits.base);
778 gHs->heaps[i].limit - gHs->heaps[i].base);
782 if (gHs->markBits.max < (uintptr_t)gHs->heaps[i].limit) {
783 gHs->markBits.max = (uintptr_t)gHs->heaps[i].limit;
923 // Calling mspace_free on shared heaps disrupts sharing too
925 // mspace_free, but on the other heaps we only do some
927 if (heap == gHs->heaps) {
1010 return heap != hs->heaps;
1074 gHs->heaps[0].maximumSize = gHs->maximumSize - overhead;
1075 gHs->heaps[0].limit = gHs->heaps[0].base + gHs->heaps[0].maximumSize;
1080 * Return the real bytes used by old heaps plus the soft usage of the
1092 ret += hs->heaps[0].bytesAllocated;
1121 mspace msp = hs->heaps[0].msp;
1156 * Old heaps will count against the ideal size.
1258 * Avoid letting the old heaps influence the target free size,
1267 /* The ideal size includes the old heaps; add overhead so that
1312 Heap *heap = &hs->heaps[i];
1344 /* Walk the heaps from oldest to newest.
1349 mspace_walk_heap(hs->heaps[i-1].msp, callback, arg);
1354 * Gets the number of heaps available in the heap source.