Lines Matching refs:thiscache
949 cache_t *thiscache; in reinit_cpu_list() local
964 for (thiscache = cachehead->mt_cache; thiscache != NULL; in reinit_cpu_list()
965 thiscache = thiscache->mt_next) { in reinit_cpu_list()
966 (void) mutex_lock(&thiscache->mt_cache_lock); in reinit_cpu_list()
967 if (thiscache->mt_nfree == 0) { in reinit_cpu_list()
969 &thiscache->mt_cache_lock); in reinit_cpu_list()
972 if (thiscache != NULL) in reinit_cpu_list()
973 reinit_cache(thiscache); in reinit_cpu_list()
974 (void) mutex_unlock(&thiscache->mt_cache_lock); in reinit_cpu_list()
983 reinit_cache(cache_t *thiscache) in reinit_cache() argument
989 freeblocks = (uint32_t *)thiscache->mt_freelist; in reinit_cache()
990 while (freeblocks < (uint32_t *)thiscache->mt_arena) { in reinit_cache()
995 (uint32_t *)thiscache->mt_freelist) in reinit_cache()
996 << 5) + i) * thiscache->mt_size; in reinit_cache()
997 ret = thiscache->mt_arena + n; in reinit_cache()
1000 thiscache->mt_size); in reinit_cache()
1012 cache_t *thiscache, *hintcache; in malloc_internal() local
1042 thiscache = cachehead->mt_hint; in malloc_internal()
1044 while (thiscache != NULL && thiscache->mt_nfree == 0) in malloc_internal()
1045 thiscache = thiscache->mt_next; in malloc_internal()
1047 if (thiscache == NULL) { in malloc_internal()
1049 thiscache = cachehead->mt_cache; in malloc_internal()
1052 while (thiscache != NULL && thiscache != hintcache && in malloc_internal()
1053 thiscache->mt_nfree == 0) in malloc_internal()
1054 thiscache = thiscache->mt_next; in malloc_internal()
1056 if (thiscache == hintcache) in malloc_internal()
1057 thiscache = NULL; in malloc_internal()
1061 if (thiscache == NULL) { /* there are no free caches */ in malloc_internal()
1065 thiscache = (cache_t *)morecore(thisrequest * HUNKSIZE); in malloc_internal()
1067 if (thiscache == (cache_t *)-1) { in malloc_internal()
1072 create_cache(thiscache, buffer_size, thisrequest); in malloc_internal()
1075 thiscache->mt_next = cachehead->mt_cache; in malloc_internal()
1076 cachehead->mt_cache = thiscache; in malloc_internal()
1080 cachehead->mt_hint = thiscache; in malloc_internal()
1083 (void) mutex_lock(&thiscache->mt_cache_lock); in malloc_internal()
1085 freeblocks = (uint32_t *)thiscache->mt_freelist; in malloc_internal()
1086 while (freeblocks < (uint32_t *)thiscache->mt_arena) { in malloc_internal()
1090 if (freeblocks < (uint32_t *)thiscache->mt_arena && in malloc_internal()
1094 if (freeblocks < (uint32_t *)thiscache->mt_arena && in malloc_internal()
1098 if (freeblocks < (uint32_t *)thiscache->mt_arena && in malloc_internal()
1124 thiscache->mt_nfree--; in malloc_internal()
1126 (void) mutex_unlock(&thiscache->mt_cache_lock); in malloc_internal()
1129 n = (uintptr_t)(((freeblocks - (uint32_t *)thiscache->mt_freelist) << 5) in malloc_internal()
1130 + i) * thiscache->mt_size; in malloc_internal()
1138 ret = thiscache->mt_arena + n; in malloc_internal()
1141 *(uintptr_t *)ret = (uintptr_t)thiscache; in malloc_internal()
1147 assert(ret + thiscache->mt_size <= thiscache->mt_freelist + in malloc_internal()
1148 thiscache->mt_span); in malloc_internal()
1507 cache_t *thiscache; in malloc_prepare() local
1515 for (thiscache = cachehead->mt_cache; in malloc_prepare()
1516 thiscache != NULL; in malloc_prepare()
1517 thiscache = thiscache->mt_next) { in malloc_prepare()
1519 &thiscache->mt_cache_lock); in malloc_prepare()
1530 cache_t *thiscache; in malloc_release() local
1536 for (thiscache = cachehead->mt_cache; in malloc_release()
1537 thiscache != NULL; in malloc_release()
1538 thiscache = thiscache->mt_next) { in malloc_release()
1540 &thiscache->mt_cache_lock); in malloc_release()