- 25 Jul, 2020 1 commit
-
-
KOBAYASHI Shuji authored
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.
-
- 22 Jul, 2020 11 commits
-
-
Yukihiro "Matz" Matsumoto authored
-
Yukihiro "Matz" Matsumoto authored
It happens when a hash made empty calls `rehash`.
-
Yukihiro "Matz" Matsumoto authored
-
Yukihiro "Matz" Matsumoto authored
-
Yukihiro "Matz" Matsumoto authored
To make debugging easy, and to improve the performance little bit.
-
Yukihiro "Matz" Matsumoto authored
The responsibility moved to caller to avoid confusion. Currently the function is called from only 2 places, so it is relatively easy to ensure not to update `gray_list` in the caller. But the assumption may change in the future.
-
Yukihiro "Matz" Matsumoto authored
`mrb_ary_modify` calls `mrb_write_barrier`, so can cause the same problem of the past `push`. It is provided for use-level API.
-
Yukihiro "Matz" Matsumoto authored
When the array is very big, the simpler `mrb_write_barrier` causes calling `gc_mark_children` for big arrays repeatedly. That would hinder performance very badly.
-
Yukihiro "Matz" Matsumoto authored
-
Yukihiro "Matz" Matsumoto authored
-
Yukihiro "Matz" Matsumoto authored
-
- 21 Jul, 2020 1 commit
-
-
Yukihiro "Matz" Matsumoto authored
-
- 20 Jul, 2020 1 commit
-
-
Yukihiro "Matz" Matsumoto authored
-
- 19 Jul, 2020 9 commits
-
-
Yukihiro "Matz" Matsumoto authored
Extract memsize to gem
-
Rory OConnell authored
-
Rory OConnell authored
Those methods are originally CRuby specific. Co-authored-by:
Yukihiro "Matz" Matsumoto <matz@ruby.or.jp>
-
Yukihiro "Matz" Matsumoto authored
Those tests succeeds only on some configuration.
-
Yukihiro "Matz" Matsumoto authored
The old code compiles only on `MRB_NO_BOXING`.
-
Yukihiro "Matz" Matsumoto authored
-
Yukihiro "Matz" Matsumoto authored
-
Yukihiro "Matz" Matsumoto authored
`mrb_value` may or may not be struct according to configuration.
-
Yukihiro "Matz" Matsumoto authored
-
- 18 Jul, 2020 8 commits
-
-
Yukihiro "Matz" Matsumoto authored
-
Yukihiro "Matz" Matsumoto authored
`C` retrieves a `mrb_value` that refers a class/module. `c` retrieves a `struct RClass*` pointer to a class/module.
-
Yukihiro "Matz" Matsumoto authored
-
Yukihiro "Matz" Matsumoto authored
`ObjectSpace.memsize_of_all` takes a class and count memory size of all instances of the class and its subclasses (if any).
-
Yukihiro "Matz" Matsumoto authored
Add ObjectSpace.memsize_of_all
-
Rory O'Connell authored
-
Rory OConnell authored
-
Rory OConnell authored
-
- 17 Jul, 2020 9 commits
-
-
Yukihiro "Matz" Matsumoto authored
This bug has been there since mruby 1.4.0 (2018-04).
-
Yukihiro "Matz" Matsumoto authored
-
Yukihiro "Matz" Matsumoto authored
Also avoid `mrb_funcall` to minimize VM recursion.
-
Yukihiro "Matz" Matsumoto authored
Memory size of a Fiber is calculated by stack size only in CRuby.
-
Yukihiro "Matz" Matsumoto authored
-
Yukihiro "Matz" Matsumoto authored
This is enhancement from CRuby's `memsize_of`. We need to change the CRuby first for the enhancement.
-
Yukihiro "Matz" Matsumoto authored
-
Yukihiro "Matz" Matsumoto authored
-
Yukihiro "Matz" Matsumoto authored
-