Skip to content

Commit

Permalink
Cast to void pointer to suppress -Wformat-pedantic in RUBY_DEBUG_LOG
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu committed Oct 3, 2021
1 parent ceeae31 commit ff480f2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions gc.c
Expand Up @@ -1868,7 +1868,7 @@ heap_add_freepage(rb_heap_t *heap, struct heap_page *page)
page->free_next = heap->free_pages;
heap->free_pages = page;

RUBY_DEBUG_LOG("page:%p freelist:%p", page, page->freelist);
RUBY_DEBUG_LOG("page:%p freelist:%p", (void *)page, (void *)page->freelist);

asan_poison_memory_region(&page->freelist, sizeof(RVALUE*));
}
Expand Down Expand Up @@ -2366,7 +2366,7 @@ heap_next_freepage(rb_objspace_t *objspace, rb_size_pool_t *size_pool, rb_heap_t
heap->free_pages = page->free_next;

GC_ASSERT(page->free_slots != 0);
RUBY_DEBUG_LOG("page:%p freelist:%p cnt:%d", page, page->freelist, page->free_slots);
RUBY_DEBUG_LOG("page:%p freelist:%p cnt:%d", (void *)page, (void *)page->freelist, page->free_slots);

asan_unpoison_memory_region(&page->freelist, sizeof(RVALUE*), false);

Expand Down Expand Up @@ -5701,7 +5701,7 @@ gc_sweep_step(rb_objspace_t *objspace, rb_size_pool_t *size_pool, rb_heap_t *hea
do {
GC_ASSERT(sweep_page->size_pool == size_pool);

RUBY_DEBUG_LOG("sweep_page:%p", sweep_page);
RUBY_DEBUG_LOG("sweep_page:%p", (void *)sweep_page);

struct gc_sweep_context ctx = {
.page = sweep_page,
Expand Down Expand Up @@ -8713,7 +8713,7 @@ rb_gc_ractor_newobj_cache_clear(rb_ractor_newobj_cache_t *newobj_cache)
{
struct heap_page *page = newobj_cache->using_page;
RVALUE *freelist = newobj_cache->freelist;
RUBY_DEBUG_LOG("ractor using_page:%p freelist:%p", page, freelist);
RUBY_DEBUG_LOG("ractor using_page:%p freelist:%p", (void *)page, (void *)freelist);

heap_page_freelist_append(page, freelist);

Expand Down
2 changes: 1 addition & 1 deletion ractor.c
Expand Up @@ -1922,7 +1922,7 @@ rb_ractor_terminate_interrupt_main_thread(rb_ractor_t *r)
rb_threadptr_interrupt(main_th);
}
else {
RUBY_DEBUG_LOG("killed (%p)", main_th);
RUBY_DEBUG_LOG("killed (%p)", (void *)main_th);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion thread.c
Expand Up @@ -992,7 +992,7 @@ thread_create_core(VALUE thval, struct thread_create_params *params)

rb_native_mutex_initialize(&th->interrupt_lock);

RUBY_DEBUG_LOG("r:%u th:%p", rb_ractor_id(th->ractor), th);
RUBY_DEBUG_LOG("r:%u th:%p", rb_ractor_id(th->ractor), (void *)th);

rb_ractor_living_threads_insert(th->ractor, th);

Expand Down

0 comments on commit ff480f2

Please sign in to comment.