Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change type of internal variables from word to size_t where applicable
(refactoring) * allchblk.c (GC_dump_regions, GC_remove_from_fl, GC_add_to_fl, GC_get_first_part, drop_hblk_in_chunks, GC_allochblk_nth, GC_freehblk): Remove casts to size_t. * blacklst.c (GC_is_black_listed): Likewise. * dbg_mlc.c (GC_debug_free): Likewise. * finalize.c (GC_grow_table): Likewise. * allchblk.c (GC_merge_unmapped): Rename nextsize local variable to next_size. * allchblk.c (GC_merge_unmapped, next_hblk_fits_better, GC_freehblk): Change type of size, next_size local variables from word to size_t. * allchblk.c (GC_get_first_part): Rename bytes argument to size_needed. * allchblk.c (GC_split_block): Change type of h_size local variable from word to size_t. * allchblk.c (next_hblk_fits_better): Change type of size_avail, size_needed arguments from word to size_t. * allchblk.c (find_nonbl_hblk): Change type of size_remain, eff_size_needed arguments from word to size_t. * allchblk.c (GC_allochblk_nth): Change type of size_needed, size_avail local variables from word to size_t. * allchblk.c (GC_merge_unmapped, GC_freehblk): Use SIZET_SIGNB instead of SIGNB. * alloc.c (GC_set_fl_marks, GC_clear_fl_marks): Change type of bit_no local variable from unsigned to size_t. * alloc.c (GC_add_to_heap, GC_scratch_recycle_inner): Rename bytes argument to sz; update comment. * include/private/gc_priv.h (GC_scratch_recycle_inner): Likewise. * alloc.c (GC_expand_hp_inner): Rename bytes local variable to sz. * backgraph.c (per_object_func, reset_back_edge, add_back_edges, update_max_height): Rename n_bytes argument to sz; rename gc_descr argument to descr. * blacklst.c (GC_unpromote_black_lists, GC_add_to_black_list_stack, GC_number_stack_black_listed): Change type of index local variable from word to size_t. * os_dep.c [MPROTECT_VDB] (GC_write_fault_handler, GC_remove_protection): Likewise. * os_dep.c [PROC_VDB] (GC_proc_read_dirty): Likewise. * os_dep.c [SOFT_VDB] (soft_set_grungy_pages): Likewise. * os_dep.c [!NO_MANUAL_VDB] (GC_dirty_inner): Likewise. * os_dep.c [!GC_DISABLE_INCREMENTAL] (GC_page_was_dirty): Likewise. * os_dep.c [GWW_VDB || PROC_VDB || SOFT_VDB] (GC_page_was_ever_dirty): Likewise. * os_dep.c [MPROTECT_VDB && DARWIN] (catch_exception_raise): Likewise. * dbg_mlc.c (GC_has_other_debug_info, GC_debug_free): Change type of sz local variable from word to size_t. * misc.c (GC_base): Likewise. * ptr_chck.c (GC_same_obj, GC_is_valid_displacement): Likewise. * dbg_mlc.c (GC_store_debug_info_inner): Change type of sz argument from word to size_t. * dbg_mlc.c (store_debug_info, GC_start_debugging_inner, GC_debug_register_displacement, GC_debug_generic_malloc): Remove cast to word. * gcj_mlc.c (GC_debug_gcj_malloc): Likewise. * include/private/gc_priv.h (GC_store_debug_info_inner): Likewise. * reclaim.c (GC_clear_block): Likewise. * dbg_mlc.c (GC_check_annotated_obj): Change type of gc_sz local variable from word to size_t. * finalize.c (HASH3): Add a cast to have result of size_t type. * include/private/gc_priv.h (PHT_HASH): Likewise. * include/private/specific.h (ts_quick_thread_id): Likewise. * finalize.c (HASH2, GC_grow_table): Cast to size_t instead of word. * include/private/specific.h (INVALID_QTID): Likewise. * mark.c (GC_set_mark_bit, GC_clear_mark_bit, GC_is_marked, GC_push_marked): Likewise. * typd_mlc.c (GC_make_descriptor): Likewise. * finalize.c (hash_chain_entry.fo_object_size): Rename to fo_object_sz and change its type from word to size_t. * finalize.c (GC_grow_table): Change type of entries_ptr argument to const size_t*. * finalize.c (GC_grow_table): Change type for i local variable from word to size_t. * os_dep.c [MSWINCE] (GC_wince_get_mem): Likewise. * os_dep.c [GWW_VDB] (GC_gww_read_dirty, GC_gww_read_dirty): Likewise. * os_dep.c [SOFT_VDB] (GC_soft_read_dirty): Likewise. * finalize.c (GC_grow_table): Change type for old_size, new_size local variables from word to size_t. * finalize.c (GC_old_dl_entries, GC_old_ll_entries): Change type from word to size_t. * include/private/gc_priv.h (dl_hashtbl_s.entries, _GC_arrays._n_heap_bases, _GC_arrays._n_root_sets): Likewise. * typd_mlc.c (LeafDescriptor.ld_size, LeafDescriptor.ld_nelements, ComplexArrayDescriptor.ad_nelements): * finalize.c (GC_finalize, GC_enqueue_all_finalizers): Cast curr_fo->fo_object_sz to word. * headers.c (GC_next_block): Change type of j local variable from word to size_t. * include/private/gc_priv.h (SIZET_SIGNB): New macro. * include/private/gc_priv.h (GC_SQRT_SIZE_MAX): Replace CPP_WORDSZ to sizeof(size_t)*8. * include/private/gc_priv.h [IA64] (GC_push_all_register_sections): Change type of eager argument from int to GC_bool. * mark_rts.c [IA64] (GC_push_all_register_sections): Likewise. * include/private/gc_priv.h (MARK_BIT_NO): Remove cast to unsigned. * include/private/gc_priv.h (GC_remove_protection): Change type of nblocks argument from word to size_t. * os_dep.c [MPROTECT_VDB] (GC_remove_protection): Likewise. * include/private/pthread_support.h [E2K] (GC_StackContext_Rep.ps_ofs): Adjust comment. * include/private/pthread_support.h [GC_ENABLE_SUSPEND_THREAD && SIGNAL_BASED_STOP_WORLD] (GC_suspend_self_inner): Change type of suspend_cnt argument from word to size_t. * pthread_stop_world.c [GC_ENABLE_SUSPEND_THREAD] (GC_suspend_self_inner): Likewise. * include/private/specific.h (GC_slow_getspecific): Change type of qtid argument from word to size_t. * specific.c (GC_slow_getspecific): Likewise. * include/private/specific.h (GC_getspecific): Change type of qtid local variable from word to size_t. * mark.c (GC_set_hdr_marks): Change type of i, n_marks local variables from unsigned to size_t; remove cast to unsigned. * os_dep.c [CHECKSUMS && GWW_VDB || PROC_VDB] (GC_or_pages): Likewise. * os_dep.c [MPROTECT_VDB] (GC_protect_heap, GC_unprotect_all_heap): Likewise. * mark.c (GC_set_mark_bit, GC_clear_mark_bit, GC_is_marked, GC_push_marked): Change type of bit_no local variable from word to size_t. * reclaim.c (GC_reclaim_clear, GC_reclaim_uninit, GC_disclaim_and_reclaim, GC_reclaim_check, GC_reclaim_block): Likewise. * mark.c (GC_steal_mark_stack): Rename max argument to n_to_get and change its type from unsigned to size_t; update comment; change type of i local variable from unsigned to size_t. * mark.c (GC_mark_local): Change type of n_to_get local variable from unsigned to size_t. * mark_rts.c (GC_compute_root_size, GC_print_static_roots, GC_is_static_root, GC_add_roots_inner, GC_rebuild_root_index, GC_remove_tmp_roots, GC_remove_roots_inner, GC_remove_roots_subregion, GC_remove_roots_inner, GC_is_tmp_root, GC_push_roots): Change type of i, j local variables from int to size_t. * os_dep.c [!OS2 && MSWIN32] (GC_register_data_segments): Likewise. * mark_rts.c (GC_is_static_root, GC_is_tmp_root): Change type of last_root_set static variable from int to size_t. * mark_rts.c (rt_hash): Change type of result from int to size_t. * mark_rts.c (GC_roots_present, add_roots_to_index): Change type of h local variable from int to size_t. * mark_rts.c [DEBUG_ADD_DEL_ROOTS] (GC_add_roots_inner): Change printf format specifier for n_root_sets from %d to %u. * mark_rts.c (GC_remove_root_at_pos, swap_static_roots): Change type of i, j arguments from int to size_t; add assertion that i<n_root_sets. * mark_rts.c [!ANY_MSWIN](GC_remove_tmp_roots, GC_remove_roots_inner): Change type of old_n_roots local variable from int to size_t. * mark_rts.c [AO_HAVE_load && HAS_REAL_READER_LOCK] (GC_is_tmp_root): Remove cast to int, unsigned and AO_t. * misc.c [!THREADS] (GC_bytes_allocd_at_reset): Move static variable definition upper (to be near GC_stack_last_cleared). * misc.c [!CPPCHECK] (GC_init): Add static assertion about size of size_t. * misc.c (GC_init): Pass 0 instead of 0L to GC_register_displacement_inner(). * misc.c [!THREADS] (GC_call_with_gc_active): Adjust indentation. * os_dep.c [!OS2 && MSWIN32] (GC_no_win32_dlls, GC_wnt, GC_init_win32, GC_register_data_segments, GC_least_described_address): Reformat comment. * os_dep.c [!OS2 && ANY_MSWIN] (GC_max_root_size, GC_is_malloc_heap_base, GC_free_malloc_heap_list): Likewise. * os_dep.c [DATASTART_USES_BSDGETDATASTART] (GC_FreeBSDGetDataStart): Likewise. * os_dep.c [!OS2 && !ANY_MSWIN && !AMIGA && !OPENBSD] (GC_register_data_segments): Likewise. * reclaim.c [!NO_DEBUGGING] (Print_stats): Likewise. * typd_mlc.c (GC_make_descriptor): Likewise. * os_dep.c [!OS2 && MSWIN32] (GC_least_described_address): Change a (name of the variable) to p in comment; move buf local variable to the nested block. * os_dep.c [!OS2 && MSWIN32] (GC_register_root_section): Move definition upper to be near GC_least_described_address(); remove protect local variable. * os_dep.c [MSWINCE] (GC_wince_get_mem): Do not decrement GC_n_heap_bases if it is zero. * os_dep.c [GWW_VDB] (GC_gww_read_dirty): Rename hash local variable to index and change its type from word to size_t. * os_dep.c [MPROTECT_VDB] (GC_protect_heap): Change type of nblocks from word to size_t. * os_dep.c [PROC_VDB] (GC_proc_read_dirty): Change type of i, nmaps local variables from int to size_t. * os_dep.c [!GC_DISABLE_INCREMENTAL && PCR_VDB] (GC_read_dirty): Change type of onhs, nhs variables from int to size_t. * os_dep.c [MPROTECT_VDB && DARWIN] (catch_exception_raise): Change type for i local variable from unsigned int to size_t. * pthread_support.c [USE_SPIN_LOCK] (GC_lock): Likewise. * pthread_stop_world.c [GC_ENABLE_SUSPEND_THREAD] (GC_suspend_handler_inner, GC_suspend_thread, GC_resume_thread): Change type of suspend_cnt local variable from word to AO_t; remove casts to word and AO_t. * pthread_support.c [GC_ENABLE_SUSPEND_THREAD && SIGNAL_BASED_STOP_WORLD] (GC_do_blocking_inner, GC_suspend_self_blocked, GC_call_with_gc_active): Likewise. * pthread_support.c [!USE_SPIN_LOCK && !NO_PTHREAD_TRYLOCK && USE_PTHREAD_LOCKS || GC_PTHREADS_PARAMARK] (GC_generic_lock): Cast SPIN_MAX to unsigned. * pthread_support.c [USE_SPIN_LOCK] (GC_lock): Replace my_last_spins local variable to my_last_spins_half; change type of my_spin_max, my_last_spins_half local variables from unsigned to AO_t; remove casts to AO_t. * ptr_chck.c (GC_same_obj, GC_is_valid_displacement): Remove pdispl local variable. * ptr_chck.c (GC_is_valid_displacement): Change type of offset local variable from word to size_t; change the expression (in an invariant way) for computing descr to use signed_word type. * reclaim.c (GC_reclaim_small_nonempty_block, GC_disclaim_and_reclaim_or_free_small_block): Add comment for the cast. * reclaim.c (GC_reclaim_block): Cast sz to word. * reclaim.c [!NO_DEBUGGING && !USE_MARK_BYTES] (count_ones): Rename n argument to v; adjust indentation. * reclaim.c [!NO_DEBUGGING] (GC_print_block_descr): Change type of n_marks, n_objs from unsigned to size_t and cast them to unsigned in printf call; remove casts to word. * typd_mlc.c: Reformat comment. * typd_mlc.c (GC_add_ext_descriptor): Change type of nbits argument from word to size_t; change tpe of ed_size local variable from word to size_t. * typd_mlc.c (GC_init_explicit_typing): Replace (word)-1 to GC_WORD_MAX. * typd_mlc.c (GC_make_leaf_descriptor): Change type of nelements argument from word to size_t; reformat code. * typd_mlc.c (GC_calloc_prepare_explicitly_typed): Remove casts to word. * typd_mlc.c (GC_descr_obj_size): Change type of result from word to size_t; change type of i, nelements, sz local variables from word to size_t.
- Loading branch information