We are proudly announcing the stable release of mruby 2.0 series - mruby 2.0.1.
Enumerator::Chain
, Enumerable#chain
and Enumerator#+
.<<
and >>
to Proc
and Method
.String#to_str
, Integer#to_int
, Float#to_int
Float#to_s
#4225Module#<
, Module<=
, Module>
, Module>=
, Module<=>
info locals
command.MRB_API mrb_value mrb_ary_splice(mrb_state *mrb, mrb_value self, mrb_int head, mrb_int len, mrb_value rpl);
MRB_API void mrb_notimplement(mrb_state*);
MRB_API mrb_value mrb_vformat(mrb_state *mrb, const char *format, va_list ap);
MRB_API double mrb_cstr_to_dbl(mrb_state *mrb, const char *s, mrb_bool badcheck);
MRB_API mrb_value mrb_cstr_to_inum(mrb_state *mrb, const char *s, mrb_int base, mrb_bool badcheck);
MRB_API void mrb_hash_foreach(mrb_state *mrb, struct RHash *hash, mrb_hash_foreach_func *func, void *p);
MRB_API mrb_int mrb_hash_size(mrb_state *mrb, mrb_value hash);
MRB_API void mrb_iv_foreach(mrb_state *mrb, mrb_value obj, mrb_iv_foreach_func *func, void *p);
MRB_API mrb_time_at(mrb_state *mrb, double sec, double usec, enum mrb_timezone zone);
Remove symbol hash table from mrb_state
structure.
Use linear search instead. Number of symbols is usually small (<1K), so we don’t need performance boost from hash tables. In our benchmark measurement, hash tables consumes 790KB for build/full-debug/mrbtest
.
Implement inline packed symbols.
Small symbols with all alphanumeric characters (<5) are packed in 32bit symbol integer a la base64.
This means those small symbols are not listed in Symbol.all_symbols
.
There are three major breaking changes from mruby 2.0.0
Developers must use following APIs for accessing attributes of RRange because RRange structure depends on boxing setting.
static
(MRB_API
was not needed):mrb_mod_module_function()
, mrb_obj_hash()
, mrb_str_len_to_inum()
, sym2name_len()
MRB_API
from definitions (referenced from within libmruby
):mrb_mod_cv_defined()
, mrb_mod_cv_get()
, mrb_f_send()
mrb_parser_get_filename
: return value changed to mrb_sym
.mrb_debug_get_filename
: add mrb_state*
as a first argument.mrb_debug_get_line
: ditto.Kernel#class_defined?
which is not available in CRuby; #3829BYTE_ORDER
; fix #4190Symbol#size
for multi-byte characters with MRB_UTF8_STRING
.OP_ENTER
to blocks without parameters; fix #4175void_expr_error
; fix #4203 #4192sort
; ref #4307time_update_datetime
; fix #4308We have done 371 commits to 163 files, 2,397 lines were added, 1,570 lines removed since mruby 2.0.0. For more detail of the updates, see Commit Log.
Let’s try mruby 2.0.1
.