Lines Matching refs:IndexT
28 typedef u32 IndexT; typedef
30 IndexT cache[kSize];
39 typedef typename Cache::IndexT IndexT; typedef
45 static_assert((kL1Size * kL2Size) <= (1ull << (sizeof(IndexT) * 8)),
49 static_assert(sizeof(T) > sizeof(IndexT),
68 IndexT Alloc(Cache *c) { in Alloc()
74 void Free(Cache *c, IndexT idx) { in Free()
81 T *Map(IndexT idx) { in Map()
92 IndexT idx = c->cache[--c->pos]; in FlushCache()
93 *(IndexT*)Map(idx) = freelist_; in FlushCache()
110 IndexT freelist_ = {0};
127 IndexT start = fillpos == 0 ? 1 : 0; in Refill()
128 for (IndexT i = start; i < kL2Size; i++) { in Refill()
130 *(IndexT *)(batch + i) = i + 1 + fillpos * kL2Size; in Refill()
132 *(IndexT*)(batch + kL2Size - 1) = 0; in Refill()
138 IndexT idx = freelist_; in Refill()
140 freelist_ = *(IndexT*)Map(idx); in Refill()
147 IndexT idx = c->cache[--c->pos]; in Drain()
148 *(IndexT*)Map(idx) = freelist_; in Drain()