Lines Matching refs:index
325 static inline void set_free_list_bit(int index) {
326 theheap.free_list_bits[index >> 5] |= (1u << (31 - (index & 0x1f)));
329 static inline void clear_free_list_bit(int index) {
330 theheap.free_list_bits[index >> 5] &= ~(1u << (31 - (index & 0x1f)));
333 static int find_nonempty_bucket(int index) {
334 uint32_t mask = (1u << (31 - (index & 0x1f))) - 1;
336 mask &= theheap.free_list_bits[index >> 5];
338 return (index & ~0x1f) + __builtin_clz(mask);
340 for (index = ROUNDUP(index + 1, 32);
341 index <= NUMBER_OF_BUCKETS; index += 32) {
342 mask = theheap.free_list_bits[index >> 5];
344 return index + __builtin_clz(mask);
359 int index = size_to_index_freeing(size - sizeof(header_t));
360 set_free_list_bit(index);
361 free_t** bucket = &theheap.free_lists[index];
774 unsigned int index = (unsigned int)rand() % 16;
780 // printf("index 0x%x\n", index);
781 if (ptr[index]) {
782 // printf("freeing ptr[0x%x] = %p\n", index, ptr[index]);
783 cmpct_free(ptr[index]);
784 ptr[index] = 0;
787 ptr[index] = cmpct_memalign((unsigned int)rand() % 32768, align);
788 // printf("ptr[0x%x] = %p, align 0x%x\n", index, ptr[index], align);
790 DEBUG_ASSERT(((addr_t)ptr[index] % align) == 0);