Lines Matching defs:arenas

936 /* on 64-bit platforms use larger pools and arenas if we can */
945 * The allocator sub-allocates <Big> blocks of memory (called arenas) aligned
948 * means that the memory arenas will be used entirely. A malloc(<Big>) is
1007 uint arenaindex; /* index into arenas of base adr */
1015 /* Record keeping for arenas. */
1198 `arenas` is a vector of arena_objects. It contains maxarenas entries, some of
1200 currently associated with an allocated arena). Note that arenas proper are
1203 Prior to Python 2.5, arenas were never free()'ed. Starting with Python 2.5,
1204 we do try to free() arenas, and use some mild heuristic strategies to increase
1205 the likelihood that arenas eventually can be freed.
1217 This is a doubly-linked list of the arena_objects associated with arenas
1220 allocated arenas first (ascending order based on the nfreepools member).
1222 which gives the nearly empty arenas a chance to be returned to the system.
1223 In my unscientific tests this dramatically improved the number of arenas
1232 number of arenas. That didn't really matter when there were only a few
1233 hundred arenas (typical!), but could be a timing disaster when there were
1242 /* Array of objects used to track chunks of memory (arenas). */
1243 static struct arena_object* arenas = NULL;
1244 /* Number of slots currently allocated in the `arenas` vector. */
1253 * arena_objects associated with arenas that have pools available.
1261 * 16 = can allocate 16 arenas = 16 * ARENA_SIZE = 4MB before growing the
1262 * `arenas` vector.
1266 /* Number of arenas allocated that haven't been free()'d. */
1282 /* Skip arenas which are not allocated. */
1283 if (arenas[i].address == 0) {
1287 uintptr_t base = (uintptr_t)_Py_ALIGN_UP(arenas[i].address, POOL_SIZE);
1290 assert(base <= (uintptr_t) arenas[i].pool_address);
1291 for (; base < (uintptr_t) arenas[i].pool_address; base += POOL_SIZE) {
1420 arena_coverage_t arenas[MAP_BOT_LENGTH];
1485 /* The radix tree only tracks arenas. So, for 16 MiB arenas, we throw
1523 n_hi->arenas[i3].tail_hi = is_used ? -1 : 0;
1532 n_hi->arenas[i3].tail_hi = is_used ? tail : 0;
1542 n_hi->arenas[i3].tail_hi = 0;
1546 n_lo->arenas[i3_next].tail_lo = is_used ? tail : 0;
1562 int32_t hi = n->arenas[i3].tail_hi;
1563 int32_t lo = n->arenas[i3].tail_lo;
1606 if (numarenas > SIZE_MAX / sizeof(*arenas))
1609 nbytes = numarenas * sizeof(*arenas);
1610 arenaobj = (struct arena_object *)PyMem_RawRealloc(arenas, nbytes);
1613 arenas = arenaobj;
1617 * previous arenas are full. Thus, there are *no* pointers
1624 /* Put the new arenas on the unused_arena_objects list. */
1626 arenas[i].address = 0; /* mark as unassociated */
1627 arenas[i].nextarena = i < numarenas - 1 ?
1628 &arenas[i+1] : NULL;
1632 unused_arena_objects = &arenas[maxarenas];
1703 arenas[(POOL)->arenaindex].address. Then P belongs to the arena if and only if
1714 before the first arena has been allocated. `arenas` is still NULL in that
1717 into a NULL arenas.
1720 arenas[(POOL)->arenaindex]. Suppose obmalloc controls P. Then (barring wild
1753 2.5, arenas were never free()'ed, and an arenaindex < maxarena always
1762 obmalloc in a small constant time, independent of the number of arenas
1779 (uintptr_t)p - arenas[arenaindex].address < ARENA_SIZE &&
1780 arenas[arenaindex].address != 0;
1887 pool->arenaindex = (uint)(usable_arenas - arenas);
1888 assert(&arenas[pool->arenaindex] == usable_arenas);
2058 struct arena_object *ao = &arenas[pool->arenaindex];
2064 * are no arenas in usable_arenas with that value.
2164 * the "most full" arenas are used first, which allows
2165 * the nearly empty arenas to be completely freed. In
2985 /* # of arenas actually allocated. */
2998 * to march over all the arenas. If we're lucky, most of the memory
3002 uintptr_t base = arenas[i].address;
3004 /* Skip arenas which are not allocated. */
3005 if (arenas[i].address == (uintptr_t)NULL)
3009 numfreepools += arenas[i].nfreepools;
3019 assert(base <= (uintptr_t) arenas[i].pool_address);
3020 for (; base < (uintptr_t) arenas[i].pool_address; base += POOL_SIZE) {
3028 assert(pool_is_in_list(p, arenas[i].freepools));
3071 (void)printone(out, "# arenas allocated total", ntimes_arena_allocated);
3072 (void)printone(out, "# arenas reclaimed", ntimes_arena_allocated - narenas);
3073 (void)printone(out, "# arenas highwater mark", narenas_highwater);
3074 (void)printone(out, "# arenas allocated current", narenas);
3077 "%zu arenas * %d bytes/arena",