Issue #206 (bdwgc).
* blacklst.c (GC_number_stack_black_listed, total_stack_black_listed):
Remove register keyword for local variables.
* dyn_load.c [IRIX5 || USE_PROC_FOR_LIBRARIES && !LINUX]
(GC_register_dynamic_libraries): Likewise.
* extra/pcr_interface.c [PCR] (GC_enumerate_block): Likewise.
* finalize.c (GC_grow_table): Likewise.
* headers.c (alloc_hdr, GC_init_headers, GC_remove_counts,
GC_prev_block): Likewise.
* include/private/gc_pmark.h (PUSH_OBJ): Likewise.
* mach_dep.c [!HAVE_PUSH_REGS && !HAVE_BUILTIN_UNWIND_INIT]
(GC_with_callee_saves_pushed): Likewise.
* mark.c (clear_marks_for_block): Likewise.
* mark_rts.c [MSWIN32 || MSWINCE || CYGWIN32] (GC_add_roots_inner):
Likewise.
* mark_rts.c [!NO_DEBUGGING] (GC_is_tmp_root): Likewise.
* os_dep.c [GWW_VDB || MPROTECT_VDB || PROC_VDB || MANUAL_VDB]
(GC_page_was_dirty): Likewise.
* os_dep.c [CHECKSUMS && GWW_VDB || PROC_VDB] (GC_or_pages,
GC_page_was_ever_dirty): Likewise.
* os_dep.c (GC_write_fault_handler): Likewise.
* os_dep.c [PROC_VDB] (GC_read_dirty): Likewise.
* os_dep.c [MPROTECT_VDB && DARWIN] (catch_exception_raise): Likewise.
* os_dep.c [SAVE_CALL_CHAIN && NARGS>0] (GC_save_callers): Likewise.
* pthread_stop_world.c [!NACL] (GC_start_world): Likewise.
* pthread_support.c (GC_delete_thread, GC_delete_gc_thread): Likewise.
* typd_mlc.c (GC_push_complex_descriptor): Likewise.
* win32_threads.c (GC_delete_gc_thread_no_free, GC_delete_thread):
Likewise.
STATIC word GC_number_stack_black_listed(struct hblk *start,
struct hblk *endp1)
{
- register struct hblk * h;
+ struct hblk * h;
word result = 0;
for (h = start; (word)h < (word)endp1; h++) {
/* Return the total number of (stack) black-listed bytes. */
static word total_stack_black_listed(void)
{
- register unsigned i;
+ unsigned i;
word total = 0;
for (i = 0; i < GC_n_heap_sects; i++) {
/* Known irrelevant map entries */
static int n_irr = 0;
struct stat buf;
- register int j;
+ int j;
for (j = 0; j < n_irr; j++) {
if (map_irr[j] == start) goto irrelevant;
void GC_enumerate_block(struct hblk *h, enumerate_data * ed)
{
- register hdr * hhdr;
- register size_t sz;
+ hdr * hhdr;
+ size_t sz;
ptr_t p;
ptr_t lim;
word descr;
STATIC void GC_grow_table(struct hash_chain_entry ***table,
signed_word *log_size_ptr)
{
- register word i;
- register struct hash_chain_entry *p;
+ word i;
+ struct hash_chain_entry *p;
signed_word log_old_size = *log_size_ptr;
signed_word log_new_size = log_old_size + 1;
word old_size = log_old_size == -1 ? 0 : (word)1 << log_old_size;
/* Return an uninitialized header */
static hdr * alloc_hdr(void)
{
- register hdr * result;
+ hdr * result;
- if (hdr_free_list == 0) {
+ if (NULL == hdr_free_list) {
result = (hdr *)GC_scratch_alloc(sizeof(hdr));
} else {
result = hdr_free_list;
GC_INNER void GC_init_headers(void)
{
- register unsigned i;
+ unsigned i;
GC_all_nils = (bottom_index *)GC_scratch_alloc(sizeof(bottom_index));
if (GC_all_nils == NULL) {
/* Remove forwarding counts for h */
GC_INNER void GC_remove_counts(struct hblk *h, size_t sz/* bytes */)
{
- register struct hblk * hbp;
+ struct hblk * hbp;
+
for (hbp = h+1; (word)hbp < (word)h + sz; hbp += 1) {
SET_HDR(hbp, 0);
}
/* Unlike the above, this may return a free block. */
GC_INNER struct hblk * GC_prev_block(struct hblk *h)
{
- register bottom_index * bi;
- register signed_word j = ((word)h >> LOG_HBLKSIZE) & (BOTTOM_SZ-1);
+ bottom_index * bi;
+ signed_word j = ((word)h >> LOG_HBLKSIZE) & (BOTTOM_SZ-1);
GET_BI(h, bi);
if (bi == GC_all_nils) {
- register word hi = (word)h >> (LOG_BOTTOM_SZ + LOG_HBLKSIZE);
+ word hi = (word)h >> (LOG_BOTTOM_SZ + LOG_HBLKSIZE);
bi = GC_all_bottom_indices_end;
while (bi != 0 && bi -> key > hi) bi = bi -> desc_link;
j = BOTTOM_SZ - 1;
/* the mark stack. */
#define PUSH_OBJ(obj, hhdr, mark_stack_top, mark_stack_limit) \
do { \
- register word _descr = (hhdr) -> hb_descr; \
+ word _descr = (hhdr) -> hb_descr; \
GC_ASSERT(!HBLK_IS_FREE(hhdr)); \
if (_descr != 0) { \
mark_stack_top++; \
/* We're not sure whether he would like */
/* to be acknowledged for it or not. */
jmp_buf regs;
- register word * i = (word *) ®s;
- register ptr_t lim = (ptr_t)(®s) + (sizeof regs);
+ word * i = (word *)®s;
+ ptr_t lim = (ptr_t)(®s) + sizeof(regs);
/* Setjmp doesn't always clear all of the buffer. */
/* That tends to preserve garbage. Clear it. */
*/
static void clear_marks_for_block(struct hblk *h, word dummy GC_ATTR_UNUSED)
{
- register hdr * hhdr = HDR(h);
+ hdr * hhdr = HDR(h);
if (IS_UNCOLLECTABLE(hhdr -> hb_obj_kind)) return;
/* Mark bit for these is cleared only once the object is */
/* virtually guaranteed to be dominated by the time it */
/* takes to scan the roots. */
{
- register int i;
+ int i;
struct roots * old = NULL; /* initialized to prevent warning. */
for (i = 0; i < n_root_sets; i++) {
GC_API int GC_CALL GC_is_tmp_root(void *p)
{
static int last_root_set = MAX_ROOT_SETS;
- register int i;
+ int i;
if (last_root_set < n_root_sets
&& (word)p >= (word)GC_static_roots[last_root_set].r_start
/* side of labeling pages as dirty (and this implementation does). */
GC_INNER GC_bool GC_page_was_dirty(struct hblk * h)
{
- register word index;
+ word index;
if (HDR(h) == 0)
return TRUE;
/* Add all pages in pht2 to pht1. */
STATIC void GC_or_pages(page_hash_table pht1, page_hash_table pht2)
{
- register unsigned i;
+ unsigned i;
for (i = 0; i < PHT_SIZE; i++) pht1[i] |= pht2[i];
}
GC_INNER GC_bool GC_page_was_ever_dirty(struct hblk * h)
# endif
{
- register word index;
+ word index;
+
if (HDR(h) == 0)
return TRUE;
index = PHT_HASH(h);
# endif
if (SIG_OK && CODE_OK) {
- register struct hblk * h =
- (struct hblk *)((word)addr & ~(GC_page_size-1));
+ struct hblk * h = (struct hblk *)((word)addr & ~(GC_page_size-1));
GC_bool in_allocd_block;
size_t i;
limit = vaddr + pagesize * npages;
for (; (word)vaddr < (word)limit; vaddr += pagesize) {
if ((*bufp++) & PG_MODIFIED) {
- register struct hblk * h;
+ struct hblk * h;
ptr_t next_vaddr = vaddr + pagesize;
# ifdef DEBUG_DIRTY_BITS
GC_log_printf("dirty page at: %p\n", (void *)vaddr);
# endif
for (h = (struct hblk *)vaddr;
(word)h < (word)next_vaddr; h++) {
- register word index = PHT_HASH(h);
+ word index = PHT_HASH(h);
set_pht_entry_from_index(GC_grungy_pages, index);
}
}
UNPROTECT(h, GC_page_size);
for (i = 0; i < divHBLKSZ(GC_page_size); i++) {
- register int index = PHT_HASH(h+i);
+ int index = PHT_HASH(h+i);
async_set_pht_entry_from_index(GC_dirty_pages, index);
}
} else if (GC_mprotect_state == GC_MP_DISCARDING) {
&& nframes < NFRAMES;
fp = (struct frame *)((long) fp -> FR_SAVFP + BIAS), nframes++) {
# if NARGS > 0
- register int i;
+ int i;
# endif
info[nframes].ci_pc = fp->FR_SAVPC;
{
# ifndef NACL
pthread_t self = pthread_self();
- register int i;
- register GC_thread p;
+ int i;
+ GC_thread p;
# ifndef GC_OPENBSD_UTHREADS
- register int n_live_threads = 0;
- register int result;
+ int n_live_threads = 0;
+ int result;
# endif
# ifdef DEBUG_THREADS
STATIC void GC_delete_thread(pthread_t id)
{
int hv = THREAD_TABLE_INDEX(id);
- register GC_thread p = GC_threads[hv];
- register GC_thread prev = 0;
+ GC_thread p = GC_threads[hv];
+ GC_thread prev = NULL;
# ifdef DEBUG_THREADS
GC_log_printf("Deleting thread %p, n_threads = %d\n",
{
pthread_t id = t -> id;
int hv = THREAD_TABLE_INDEX(id);
- register GC_thread p = GC_threads[hv];
- register GC_thread prev = 0;
+ GC_thread p = GC_threads[hv];
+ GC_thread prev = NULL;
GC_ASSERT(I_HOLD_LOCK());
while (p != t) {
STATIC mse * GC_push_complex_descriptor(word *addr, complex_descriptor *d,
mse *msp, mse *msl)
{
- register ptr_t current = (ptr_t) addr;
- register word nelements;
- register word sz;
- register word i;
+ ptr_t current = (ptr_t)addr;
+ word nelements;
+ word sz;
+ word i;
switch(d -> TAG) {
case LEAF_TAG:
{
- register GC_descr descr = d -> ld.ld_descriptor;
+ GC_descr descr = d -> ld.ld_descriptor;
nelements = d -> ld.ld_nelements;
if (msl - msp <= (ptrdiff_t)nelements) return(0);
}
case ARRAY_TAG:
{
- register complex_descriptor *descr = d -> ad.ad_element_descr;
+ complex_descriptor *descr = d -> ad.ad_element_descr;
nelements = d -> ad.ad_nelements;
sz = GC_descr_obj_size(descr);
DWORD id = ((GC_thread)t) -> id;
/* Cast away volatile qualifier, since we have lock. */
int hv = THREAD_TABLE_INDEX(id);
- register GC_thread p = GC_threads[hv];
- register GC_thread prev = 0;
+ GC_thread p = GC_threads[hv];
+ GC_thread prev = NULL;
GC_ASSERT(I_HOLD_LOCK());
while (p != (GC_thread)t) {
}
} else {
int hv = THREAD_TABLE_INDEX(id);
- register GC_thread p = GC_threads[hv];
- register GC_thread prev = 0;
+ GC_thread p = GC_threads[hv];
+ GC_thread prev = NULL;
GC_ASSERT(I_HOLD_LOCK());
while (p -> id != id) {