| Age | Commit message (Collapse) | Author | |
|---|---|---|---|
| 2020-10-12 | Reorganize `Integer` system. | Yukihiro "Matz" Matsumoto | |
| - Integrate `Fixnum` and `Integer` - Remove `Integral` - `int / int -> int` - Replace `mrb_fixnum()` to `mrb_int()` - Replace `mrb_fixnum_value()` to `mrb_int_value()`. - Use `mrb_integer_p()` instead of `mrb_fixnum_p()` | |||
| 2020-10-12 | Rename `MRB_TT_FIXNUM` to `MRB_TT_INTEGER`. | Yukihiro "Matz" Matsumoto | |
| We still have `#define MRB_TT_FIXNUM MRB_TT_INTEGER` for compatibility. | |||
| 2020-10-12 | Fix `Fixnum` and `Float` comparison in `Hash` lookup | KOBAYASHI Shuji | |
| ```console $ bin/mruby -e 'p({1 => 2}.key?(1.0))' true ``` ```console $ bin/mruby -e 'p({1 => 2}.key?(1.0))' false ``` | |||
| 2020-10-12 | Rename float configuration option names. | Yukihiro "Matz" Matsumoto | |
| - `MRB_WITHOUT_FLOAT` => `MRB_NO_FLOAT` - `MRB_USE_FLOAT` => `MRB_USE_FLOAT32` The former is to use `USE_XXX` naming convention. The latter is to make sure `float` is 32bit float and not floating point number in general. | |||
| 2020-10-12 | Rename `mrb_hash_modify` to `hash_modify`. | Yukihiro "Matz" Matsumoto | |
| Since it's an internal static function. | |||
| 2020-10-12 | Use `mrb_funcall_id()` extensively. | Yukihiro "Matz" Matsumoto | |
| Except for support files e.g. `mruby-test/driver.c`, which are not target of symbol collection via `rake gensym`. | |||
| 2020-10-12 | Add `MRB_SYM()` for inline symbols. | Yukihiro "Matz" Matsumoto | |
| 2020-08-11 | Fix `mrb_int` and `size_t` combination warnings. | Yukihiro "Matz" Matsumoto | |
| 2020-08-03 | Initialized local variables in `mrb_hash_shift()`. | Yukihiro "Matz" Matsumoto | |
| 2020-07-25 | Use type tag for hash code in `ht_hash_func()` | KOBAYASHI Shuji | |
| The function corresponding to `ht_hash_func()` was as follows in the days of khash implementation (before d78acc7a). ```c mrb_hash_ht_hash_func(mrb_state *mrb, mrb_value key) { enum mrb_vtype t = mrb_type(key); ... switch (t) { ... default: hv = mrb_funcall(mrb, key, "hash", 0); h = (khint_t)t ^ (khint_t)mrb_fixnum(hv); break; } ... } ``` When switched to the segmented list implementation (d78acc7a), this function was changed as follows. ```c sg_hash_func(mrb_state *mrb, seglist *t, mrb_value key) { enum mrb_vtype tt = mrb_type(key); ... switch (tt) { ... default: hv = mrb_funcall(mrb, key, "hash", 0); h = (size_t)t ^ (size_t)mrb_fixnum(hv); break; } ... } ``` Since the argument `t` was added, the variable for type tag was changed from `t` to `tt`, but the variable used in the expression of `h` remained `t`. Probably this is an omission of change, so fixed it. | |||
| 2020-07-23 | Fix a bug with `ht_index` called with `size==0`; fix #5046 | Yukihiro "Matz" Matsumoto | |
| It happens when a hash made empty calls `rehash`. | |||
| 2020-07-15 | mrb_ prefix convention | Rory O'Connell | |
| 2020-07-13 | Use size of hash's table in calculation | Rory OConnell | |
| 2020-06-20 | Add `mrb_get_arg1()` that retrieves single (and only) argument. | Yukihiro "Matz" Matsumoto | |
| `mrb_get_arg1()` raises `ArgumentError` if the method does not receive one argument. And replaces all `mrb_get_args(mrb, "o", &arg)` by the new function. | |||
| 2020-06-05 | Add proper casts to silence VC warnings. | Yukihiro "Matz" Matsumoto | |
| 2020-05-15 | Unify `eql?` receiver in `Hash` according to Ruby | KOBAYASHI Shuji | |
| ### Example ```ruby # example.rb class A def eql?(o) p self.class super end def hash 1 end end class B < A; end h = {A.new => 1} h[B.new] ``` #### Before this patch: ```console $ bin/mruby example.rb A ``` #### After this patch (same as Ruby) ```console $ bin/mruby example.rb B ``` | |||
| 2020-01-31 | Avoid implicit integer casting in `backtrace.c` and `hash.c`. | Yukihiro "Matz" Matsumoto | |
| 2020-01-01 | Rename `mrb_num_args_error` to `mrb_argnum_error`; ref #4863 | Yukihiro "Matz" Matsumoto | |
| 2019-12-12 | Add `mrb_num_args_error()` for "wrong number of arguments" error | KOBAYASHI Shuji | |
| To unify the style of messages. | |||
| 2019-11-02 | Fix argument specs to `Hash` | KOBAYASHI Shuji | |
| 2019-09-26 | Use type predicate macros instead of `mrb_type` if possible | KOBAYASHI Shuji | |
| For efficiency with `MRB_WORD_BOXING` (implement type predicate macros for all `enum mrb_vtype`). | |||
| 2019-09-14 | Add a macro `mrb_frozen_p` that points to `MRB_FROZEN_P`. | Yukihiro "Matz" Matsumoto | |
| 2019-07-04 | It was too early to check `key` for `undef`; ref #4534 | Yukihiro "Matz" Matsumoto | |
| 2019-06-27 | Skip copying delete keys in a hash; fix #4534 | Yukihiro "Matz" Matsumoto | |
| 2019-06-22 | Refine `Hash#rehash` example [ci skip] | KOBAYASHI Shuji | |
| Previous example doesn't work because string key (frozen) can't be modified. | |||
| 2019-04-14 | Fix memory leak for hash table index if occur out of memory | dearblue | |
| 2019-04-09 | Extract frozen checking to function | KOBAYASHI Shuji | |
| 2019-02-11 | Should not copy keys&values when a hash table is empty; fix #4270 | Yukihiro "Matz" Matsumoto | |
| 2018-12-17 | Small refactoring of #4188 | Yukihiro "Matz" Matsumoto | |
| 2018-12-14 | Add `mrb_hash_size()` function. | dearblue | |
| 2018-12-11 | Avoid using floating point number for HT_SEG_INCREASE_RATIO; ref #4182 | Yukihiro "Matz" Matsumoto | |
| 2018-12-11 | Rename `ht_foreach_func` to `mrb_hash_foreach_func`. | Yukihiro "Matz" Matsumoto | |
| 2018-12-11 | Update comments. | Yukihiro "Matz" Matsumoto | |
| 2018-12-11 | Add API function `mrb_hash_foreach()` to iterate over items in a hash. | Yukihiro "Matz" Matsumoto | |
| 2018-11-19 | Removed `to_hash` conversion method. | Yukihiro "Matz" Matsumoto | |
| 2018-11-19 | Improve Hash table using variable sized segments. | Yukihiro "Matz" Matsumoto | |
| 2018-11-16 | The key or value object could be reclaimed by GC; fix #4164 | Yukihiro "Matz" Matsumoto | |
| The GC may occur between `sg_shift` and `mrb_assoc_new`, in which case `key` and `value` could be freed even tough they are still alive. The issue is found and fixed by https://hackerone.com/hexodus | |||
| 2018-10-20 | Need to freeze string keys. | Yukihiro "Matz" Matsumoto | |
| 2018-10-12 | Should not compare `undef` (deleted) key in hashes; fix #4136 | Yukihiro "Matz" Matsumoto | |
| 2018-10-12 | Add `NULL` check in `sg_compact()`; fix #4139 | Yukihiro "Matz" Matsumoto | |
| 2018-10-12 | `Hash#delete` should return the deleted value; fix #4133 | Yukihiro "Matz" Matsumoto | |
| 2018-09-26 | Implement `Hash#rehash` in C using `sg_compact()`. | Yukihiro "Matz" Matsumoto | |
| 2018-09-26 | Add index to larger segment lists for performance | Yukihiro "Matz" Matsumoto | |
| 2018-09-26 | Use `mrb_undef_value` for delete mark instead of shifting Hash entry table. | Yukihiro "Matz" Matsumoto | |
| That means entry table should be compacted periodically by `sg_compact()`. | |||
| 2018-09-26 | Use segmented list to implement `Hash` [Experimental] | Yukihiro "Matz" Matsumoto | |
| I know it's not hash at all, but reduce memory consumption. | |||
| 2018-09-06 | Need to check if merging hash is empty; fix #4107 | Yukihiro "Matz" Matsumoto | |
| 2018-08-30 | Add new function `mrb_ensure_hash_type()`; ref #4097 | Yukihiro "Matz" Matsumoto | |
| Unlike `mrb_check_hash_type()` that returns `nil` if the argument is not a `Hash`, `mrb_ensure_hash_type()` raises a `TypeError` exception. | |||
| 2018-08-25 | Add a new function `mrb_hash_merge()`. | Yukihiro "Matz" Matsumoto | |
| 2018-07-30 | Keyword argument implemented. | Yukihiro "Matz" Matsumoto | |
| 2018-06-01 | Instead of defining `Hash#dup`, we should define `Hash#initialize_copy`. | Yukihiro "Matz" Matsumoto | |
| `Hash#clone` did not work properly; fix #4030 | |||
