/* Global data */
bitmap_element bitmap_zero_bits; /* An element of all zero bits. */
static bitmap_element *bitmap_free; /* Freelist of bitmap elements. */
-static GTY((deletable (""))) bitmap_element *bitmap_ggc_free;
+static GTY((deletable)) bitmap_element *bitmap_ggc_free;
static void bitmap_elem_to_freelist (bitmap, bitmap_element *);
static void bitmap_element_free (bitmap, bitmap_element *);
obstack_chunk_free);
}
- element = (bitmap_element *) obstack_alloc (&bitmap_obstack,
- sizeof (bitmap_element));
+ element = XOBNEW (&bitmap_obstack, bitmap_element);
}
}
else
bitmap_ggc_free = element->next;
}
else
- element = ggc_alloc (sizeof (bitmap_element));
+ element = GGC_NEW (bitmap_element);
}
memset (element->bits, 0, sizeof (element->bits));
unsigned word_num = bit / BITMAP_WORD_BITS % BITMAP_ELEMENT_WORDS;
ptr->bits[word_num] &= ~ (((BITMAP_WORD) 1) << bit_num);
- /* If we cleared the entire word, free up the element */
+ /* If we cleared the entire word, free up the element. */
if (bitmap_element_zerop (ptr))
bitmap_element_free (head, ptr);
}
#else
for (word_num = 0; word_num < BITMAP_ELEMENT_WORDS; ++word_num)
if ((word = ptr->bits[word_num]) != 0)
- break;
+ goto word_found;
+ abort ();
+ word_found:
#endif
/* Binary search for the first set bit. */
#else
for (word_num = BITMAP_ELEMENT_WORDS; word_num-- > 0; )
if ((word = ptr->bits[word_num]) != 0)
- break;
+ goto word_found;
+ abort ();
+ word_found:
#endif
/* Binary search for the last set bit. */
bitmap_initialize (bitmap head, int using_obstack)
{
if (head == NULL && ! using_obstack)
- head = ggc_alloc (sizeof (*head));
+ head = GGC_NEW (struct bitmap_head_def);
head->first = head->current = 0;
head->using_obstack = using_obstack;