summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
author卜部昌平 <shyouhei@ruby-lang.org>2019-11-18 12:13:08 +0900
committer卜部昌平 <shyouhei@ruby-lang.org>2019-11-19 12:36:19 +0900
commit0e8219f591f3f17cb7ee361e8a60dbef08145883 (patch)
tree89704f4d90521cf52ef1befc5e87429f8a9d5da3 /hash.c
parent78e266da1dede1c81e634982e76a129c5720d80e (diff)
make functions static
These functions are used from within a compilation unit so we can make them static, for better binary size. This changeset reduces the size of generated ruby binary from 26,590,128 bytes to 26,584,472 bytes on my macihne.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/2682
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/hash.c b/hash.c
index ab9af762a9..84ab343091 100644
--- a/hash.c
+++ b/hash.c
@@ -146,7 +146,7 @@ rb_hash(VALUE obj)
return hval;
}
-long rb_objid_hash(st_index_t index);
+static long rb_objid_hash(st_index_t index);
static st_index_t
dbl_to_index(double d)
@@ -264,7 +264,7 @@ key64_hash(uint64_t key, uint32_t seed)
/* Should cast down the result for each purpose */
#define st_index_hash(index) key64_hash(rb_hash_start(index), prime2)
-long
+static long
rb_objid_hash(st_index_t index)
{
return (long)st_index_hash(index);
@@ -4153,6 +4153,8 @@ rb_hash_compact_bang(VALUE hash)
return Qnil;
}
+static st_table *rb_init_identtable_with_size(st_index_t size);
+
/*
* call-seq:
* hsh.compare_by_identity -> hsh
@@ -4227,7 +4229,7 @@ rb_init_identtable(void)
return st_init_table(&identhash);
}
-st_table *
+static st_table *
rb_init_identtable_with_size(st_index_t size)
{
return st_init_table_with_size(&identhash, size);