}
}
}
- if ( !IS_UNCOLLECTABLE(kind) &&
- (kind != PTRFREE || size_needed > MAX_BLACK_LIST_ALLOC)) {
+ if ( !IS_UNCOLLECTABLE(kind) && (kind != PTRFREE
+ || size_needed > (signed_word)MAX_BLACK_LIST_ALLOC)) {
struct hblk * lasthbp = hbp;
ptr_t search_end = (ptr_t)hbp + size_avail - size_needed;
signed_word orig_avail = size_avail;
- signed_word eff_size_needed = ((flags & IGNORE_OFF_PAGE)?
- HBLKSIZE
- : size_needed);
+ signed_word eff_size_needed = (flags & IGNORE_OFF_PAGE) != 0 ?
+ (signed_word)HBLKSIZE
+ : size_needed;
while ((ptr_t)lasthbp <= search_end
my_bytes_allocd = 0;
for (p = op; p != 0; p = obj_link(p)) {
my_bytes_allocd += lb;
- if (my_bytes_allocd >= HBLKSIZE) {
+ if ((word)my_bytes_allocd >= HBLKSIZE) {
*opp = obj_link(p);
obj_link(p) = 0;
break;
local_top = GC_mark_from(local_top, local_mark_stack,
local_mark_stack + LOCAL_MARK_STACK_SIZE);
if (local_top < local_mark_stack) return;
- if (local_top - local_mark_stack >= LOCAL_MARK_STACK_SIZE/2) {
+ if ((word)(local_top - local_mark_stack)
+ >= LOCAL_MARK_STACK_SIZE / 2) {
GC_return_mark_stack(local_mark_stack, local_top);
return;
}
r = (ptr_t)((word)r & ~(WORDS_TO_BYTES(1) - 1));
{
size_t offset = HBLKDISPL(r);
- signed_word sz = candidate_hdr -> hb_sz;
+ word sz = candidate_hdr -> hb_sz;
size_t obj_displ = offset % sz;
r -= obj_displ;
IF_CANCEL(int cancel_state;)
DISABLE_CANCEL(cancel_state);
- while (bytes_written < len) {
+ while ((size_t)bytes_written < len) {
# ifdef GC_SOLARIS_THREADS
result = syscall(SYS_write, fd, buf + bytes_written,
len - bytes_written);
GC_INNER void GC_initialize_offsets(void)
{
- int i;
+ unsigned i;
if (GC_all_interior_pointers) {
for (i = 0; i < VALID_OFFSET_SZ; ++i)
GC_valid_offsets[i] = TRUE;
/* Add all pages in pht2 to pht1 */
STATIC void GC_or_pages(page_hash_table pht1, page_hash_table pht2)
{
- register int i;
+ register unsigned i;
for (i = 0; i < PHT_SIZE; i++) pht1[i] |= pht2[i];
}
if ((word)((ptr_t)p - (ptr_t)base) > (word)descr) goto fail;
break;
case GC_DS_BITMAP:
- if ((ptr_t)p - (ptr_t)base
+ if ((word)((ptr_t)p - (ptr_t)base)
>= WORDS_TO_BYTES(BITMAP_BITS)
|| ((word)p & (sizeof(word) - 1))) goto fail;
if (!(((word)1 << (WORDSZ - ((ptr_t)p - (ptr_t)base) - 1))
/* Caller does not hold allocation lock. */
STATIC void GC_init_explicit_typing(void)
{
- register int i;
+ register unsigned i;
DCL_LOCK_STATE;
GC_STATIC_ASSERT(sizeof(struct LeafDescriptor) % sizeof(word) == 0);
# define HIGH_BIT (((word)1) << (WORDSZ - 1))
if (!GC_explicit_typing_initialized) GC_init_explicit_typing();
- while (last_set_bit >= 0 && !GC_get_bit(bm, last_set_bit)) last_set_bit --;
+ while (last_set_bit >= 0 && !GC_get_bit(bm, last_set_bit))
+ last_set_bit--;
if (last_set_bit < 0) return(0 /* no pointers */);
# if ALIGNMENT == CPP_WORDSZ/8
{
}
}
# endif
- if (last_set_bit < BITMAP_BITS) {
+ if ((word)last_set_bit < BITMAP_BITS) {
/* Hopefully the common case. */
/* Build bitmap descriptor (with bits reversed) */
result = HIGH_BIT;