4 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -1575,6 +1575,12 @@ rb_hash_new_with_size(st_index_t size)
1575
1575
return ret ;
1576
1576
}
1577
1577
1578
+ VALUE
1579
+ rb_hash_new_capa (long capa )
1580
+ {
1581
+ return rb_hash_new_with_size ((st_index_t )capa );
1582
+ }
1583
+
1578
1584
static VALUE
1579
1585
hash_copy (VALUE ret , VALUE hash )
1580
1586
{
Original file line number Diff line number Diff line change @@ -106,6 +106,17 @@ VALUE rb_hash(VALUE obj);
106
106
*/
107
107
VALUE rb_hash_new (void );
108
108
109
+ /* *
110
+ * Identical to rb_hash_new(), except it additionally specifies how many keys
111
+ * it is expected to contain. This way you can create a hash that is large enough
112
+ * for your need. For large hashes it means it won't need to be reallocated and
113
+ * rehashed as much, improving performance.
114
+ *
115
+ * @param[in] capa Designed capacity of the hash.
116
+ * @return An empty Hash, whose capacity is `capa`.
117
+ */
118
+ VALUE rb_hash_new_capa (long capa);
119
+
109
120
/* *
110
121
* Duplicates a hash.
111
122
*
Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ module MakeMakefile
67
67
C_EXT = %w[ c m ]
68
68
69
69
##
70
- # Extensions for files complied with a C++ compiler
70
+ # Extensions for files compiled with a C++ compiler
71
71
72
72
CXX_EXT = %w[ cc mm cxx cpp ]
73
73
unless File . exist? ( File . join ( *File . split ( __FILE__ ) . tap { |d , b | b . swapcase } ) )
@@ -2109,7 +2109,7 @@ def timestamp_file(name, target_prefix = nil)
2109
2109
end
2110
2110
# :startdoc:
2111
2111
2112
- # creates a stub Makefile.
2112
+ # Creates a stub Makefile.
2113
2113
#
2114
2114
def dummy_makefile ( srcdir )
2115
2115
configuration ( srcdir ) << <<RULES << CLEANINGS
Original file line number Diff line number Diff line change 15
15
16
16
#define RUBY_RELEASE_YEAR 2022
17
17
#define RUBY_RELEASE_MONTH 4
18
- #define RUBY_RELEASE_DAY 26
18
+ #define RUBY_RELEASE_DAY 27
19
19
20
20
#include "ruby/version.h"
21
21
#include "ruby/internal/abi.h"
0 commit comments