1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Make internal functions static

This commit is contained in:
Nobuyoshi Nakada 2019-05-16 15:36:58 +09:00
parent 82332c7d8b
commit 973431c059
No known key found for this signature in database
GPG key ID: 4BC7D6DF58D8DF60

9
gc.c
View file

@ -7452,7 +7452,8 @@ init_cursors(rb_objspace_t *objspace, struct heap_cursor *free, struct heap_curs
scan->objspace = objspace;
}
int count_pinned(struct heap_page *page)
static int
count_pinned(struct heap_page *page)
{
RVALUE *pstart = page->start;
RVALUE *pend = pstart + page->total_slots;
@ -7476,14 +7477,16 @@ int count_pinned(struct heap_page *page)
return pinned;
}
int compare_pinned(const void *left, const void *right, void *dummy)
static int
compare_pinned(const void *left, const void *right, void *dummy)
{
int left_count = count_pinned(*(struct heap_page * const *)left);
int right_count = count_pinned(*(struct heap_page * const *)right);
return right_count - left_count;
}
int compare_free_slots(const void *left, const void *right, void *dummy)
static int
compare_free_slots(const void *left, const void *right, void *dummy)
{
struct heap_page *left_page;
struct heap_page *right_page;