Lines Matching defs:arenas
38 * + Multiple arenas are used if there are multiple CPUs, which reduces lock
41 * + Cache line sharing between arenas is avoided for internal data
46 * mechanism for associating allocations with particular arenas.
687 static size_t arena_maxclass; /* Max size class for arenas. */
759 * Arenas.
763 * Arenas that are used to service external requests. Not all elements of the
764 * arenas array are necessarily used; arenas are created lazily as needed.
766 static arena_t **arenas;
768 static malloc_mutex_t arenas_mtx; /* Protects arenas initialization. */
1504 assert(arenas[0] != NULL);
1508 if (arenas[i] == NULL)
1509 arenas[i] = arenas_extend();
1512 return arenas[thr_curcpu()];
1521 arena = arenas[thr_curcpu()];
2604 /* Create a new arena and insert it into the arenas array at index ind. */
2622 * by using arenas[0]. In practice, this is an extremely unlikely
2630 return (arenas[0]);
3177 /* arenas. */
3179 if (arenas[i] != NULL) {
3180 malloc_mutex_lock(&arenas[i]->mtx);
3182 arenas[i]->stats.allocated_small;
3184 arenas[i]->stats.allocated_large;
3185 malloc_mutex_unlock(&arenas[i]->mtx);
3228 arena = arenas[i];
3541 /* Allocate and initialize arenas. */
3542 arenas = (arena_t **)base_alloc(sizeof(arena_t *) * ncpus);
3543 if (arenas == NULL) {
3551 memset(arenas, 0, sizeof(arena_t *) * ncpus);
3557 if ((arenas[0] = arenas_extend()) == NULL) {
3817 if (arenas[i] != NULL)
3818 malloc_mutex_lock(&arenas[i]->mtx);
3840 if (arenas[i] != NULL)
3841 malloc_mutex_unlock(&arenas[i]->mtx);
3860 if (arenas[i] != NULL)
3861 malloc_mutex_init(&arenas[i]->mtx);