summaryrefslogtreecommitdiffhomepage
path: root/src
AgeCommit message (Collapse)Author
2020-08-11Fix `mrb_int` and `size_t` combination warnings.Yukihiro "Matz" Matsumoto
2020-08-08Return `NaN` for `0/0`; d8e060dYukihiro "Matz" Matsumoto
2020-08-08Should not use `mrb_float_value()` with `MRB_WITHOUT_FLOAT`.Yukihiro "Matz" Matsumoto
2020-08-08Reintroduce `mrb_static_assert`; #5051Yukihiro "Matz" Matsumoto
Note that the home brew version of `mrb_static_assert` only works within the function body. This reverts commit 8f99689.
2020-08-07Avoid `division by zero` undefined behavior.Yukihiro "Matz" Matsumoto
2020-08-06Use `memcpy` to copy stack.Yukihiro "Matz" Matsumoto
2020-08-06Use `memset()` to clear stack unless `MRB_NAN_BOXING`.Yukihiro "Matz" Matsumoto
2020-08-06Remove block clear of `callinfo`.Yukihiro "Matz" Matsumoto
2020-08-06Remove `mrb_static_assert` from the core; #5051Yukihiro "Matz" Matsumoto
2020-08-05Merge pull request #5052 from dearblue/cistacksYukihiro "Matz" Matsumoto
Extend the `cipush()` and `cipop()` functions
2020-08-03Initialized local variables in `mrb_hash_shift()`.Yukihiro "Matz" Matsumoto
2020-07-26Extend the `cipush()` and `cipop()` functionsdearblue
- Returns the updated call info. - Unify the processing around `cipush()`. - `cipop()` restores the stack.
2020-07-25Merge pull request #5049 from shuujii/use-type-tag-for-hash-code-in-ht_hash_funcYukihiro "Matz" Matsumoto
Use type tag for hash code in `ht_hash_func()`
2020-07-25Use 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-24Change the logic to calculate object (`iv_tbl`) size; #5045Yukihiro "Matz" Matsumoto
2020-07-24Merge pull request #5045 from dearblue/memsize_ofYukihiro "Matz" Matsumoto
Improve `mruby-os-memsize`
2020-07-24Improve prototype for `mrb_objspace_page_slot_size()`; ref #5032dearblue
If it qualify a return type that is not a pointer with `const`, the compiler ignores it.
2020-07-24Avoid using FPU with `mruby-os-memsize`; ref #5032dearblue
And, in the calculation of the instance variable size, the fraction was always rounded down because of division of integers, so fix it. At the same time, test items that are no longer passed due to this change are deleted.
2020-07-23Fix a bug with `ht_index` called with `size==0`; fix #5046Yukihiro "Matz" Matsumoto
It happens when a hash made empty calls `rehash`.
2020-07-22Use more `mrb_field_write_barrier` for instance variables.Yukihiro "Matz" Matsumoto
2020-07-22Use more local variables.Yukihiro "Matz" Matsumoto
To make debugging easy, and to improve the performance little bit.
2020-07-22Move `gray_list` update from `gc_mark_children`.Yukihiro "Matz" Matsumoto
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.
2020-07-22Avoid using `mrb_ary_modify` from the internal function.Yukihiro "Matz" Matsumoto
`mrb_ary_modify` calls `mrb_write_barrier`, so can cause the same problem of the past `push`. It is provided for use-level API.
2020-07-22Use `mrb_field_write_barrier` instead of `mrb_write_barrier` for `push`.Yukihiro "Matz" Matsumoto
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.
2020-07-22Skip unnecessary `mark_context` if `mrb->c == mrb->root_c`.Yukihiro "Matz" Matsumoto
2020-07-21Fix the VM stack handling bug in 'mrb_yield_with_class()`; fix #5042Yukihiro "Matz" Matsumoto
2020-07-19Use `c` specifier for `mrb_get_args`.Yukihiro "Matz" Matsumoto
2020-07-19Add new specifier `c` to `mrb_get_args`.Yukihiro "Matz" Matsumoto
`C` retrieves a `mrb_value` that refers a class/module. `c` retrieves a `struct RClass*` pointer to a class/module.
2020-07-17Use `proc->env` to check `block_given?` if possible; fix #5039Yukihiro "Matz" Matsumoto
This bug has been there since mruby 1.4.0 (2018-04).
2020-07-17Merge pull request #5032 from RoryO/add-objspace-memsize-ofYukihiro "Matz" Matsumoto
Add ObjectSpace.memsize_of
2020-07-15mrb_ prefix conventionRory O'Connell
2020-07-13Use object iv table size in calculationRory OConnell
2020-07-13Use size of hash's table in calculationRory OConnell
2020-07-13All values use page slot size in calculationRory OConnell
2020-07-11Remove the prototype declaration `mrb_free_backtrace()`dearblue
This function is removed by 9644ad5.
2020-07-06Avoid infinite loop when converting objects to strings.Yukihiro "Matz" Matsumoto
2020-07-04fix object_id of true, false, and undef all 0Rory OConnell
2020-07-02Cancel 9cdf439Yukihiro "Matz" Matsumoto
Should not free the pointer in `realloc` since it can cause use-after-free problem.
2020-06-25Remove unnecessary stack adjustment in `OP_CALL`.Yukihiro "Matz" Matsumoto
2020-06-25Free the original pointer if `realloc` failed.Yukihiro "Matz" Matsumoto
The POSIX `realloc` keep the original pointer untouched, so it can easily leads to memory leakage. `mrb_realloc()` should handle those bookkeeping, while `mrb_realloc_simple()` keeps the original `realloc` behavior.
2020-06-25Remove unnecessary `break` from `numeric.c`.Yukihiro "Matz" Matsumoto
2020-06-25Change flag names in preparation of `REnv` refactoring.Yukihiro "Matz" Matsumoto
2020-06-25Use `mrb_get_argc()` to improve performance.Yukihiro "Matz" Matsumoto
2020-06-22Skip `mrb_get_args()` in `mrb_ary_{aget,aset}` unless necessary.Yukihiro "Matz" Matsumoto
Use simpler `mrb_get_argc()` and `mrb_get_arg1()` instead.
2020-06-20Support integer and float combination in `mrb_equal()`.Yukihiro "Matz" Matsumoto
2020-06-20Move definition of `BasicObject#!=` to `mrblib`.Yukihiro "Matz" Matsumoto
C implementation used `mrb_funcall()` that bypassed many optimization.
2020-06-20Add `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-15Remove unused `MRB_TT_FILE`.Yukihiro "Matz" Matsumoto
2020-06-11Reorganize gray mark functions in GC.Yukihiro "Matz" Matsumoto
2020-06-11Remove GC test code from ancient.Yukihiro "Matz" Matsumoto