summaryrefslogtreecommitdiffhomepage
path: root/src
AgeCommit message (Collapse)Author
2020-11-02Make Ranges frozen as Ruby3.0.Yukihiro "Matz" Matsumoto
2020-10-29Merge pull request #5102 from dearblue/c++-excYukihiro "Matz" Matsumoto
Fixed build with `conf.enable_cxx_exception`
2020-10-28Fix `mrb_obj_id` to `Float`KOBAYASHI Shuji
2020-10-28Fixed build with `conf.enable_cxx_exception`dearblue
The problem was manifested by commit 5069fb15e41998dffef8e0ba566b3a82be369ba3.
2020-10-24Reorganize `env_new()` as `mrb_env_new()`dearblue
The `mrb_env_new()` function is a global function, but it is still treated as an internal function.
2020-10-23Merge pull request #5099 from dearblue/getargs-arrayYukihiro "Matz" Matsumoto
Prohibit array changes by "a"/"*" specifier of `mrb_get_args()`
2020-10-22Prohibit array changes by `mrb_get_argv()`dearblue
The `mrb_get_argv()` function will now return `const mrb_value *`. This is because it is difficult for the caller to check if it is a splat argument (array object) and to write-barrier if necessary.
2020-10-22Prohibit array changes by "a"/"*" specifier of `mrb_get_args()`dearblue
The "a"/"*" specifier of the `mrb_get_args()` function will now return `const mrb_value *`. This is because it is difficult for the caller to check if it is an array object and write-barrier if necessary. And it requires calling `mrb_ary_modify()` on the unmodified array object, which is also difficult (this is similar to #5087).
2020-10-16Add startless range (another part of #5085)Yukihiro "Matz" Matsumoto
Ref #5093; close #5085
2020-10-16Remove uninitialized local variable warning.Yukihiro "Matz" Matsumoto
Fix for #5093
2020-10-15Merge branch 'work_for_merge' of https://github.com/zubycz/mruby into ↵Yukihiro "Matz" Matsumoto
zubycz-work_for_merge
2020-10-15Fix out of bound access in `parse.y`.Yukihiro "Matz" Matsumoto
2020-10-14Add indent to `lv` in the C dump.Yukihiro "Matz" Matsumoto
2020-10-13Introduce endless range (a part of #5085)taiyoslime
Co-Authored-By: n4o847 <[email protected]> Co-Authored-By: smallkirby <[email protected]>
2020-10-12Revert "Add a new function `mrb_exc_protect()`."Yukihiro "Matz" Matsumoto
This reverts commit 8746a6fe4e7bda8a0fbc0eaece9314ec51a0c255. We already have `mrb_protect()`, `mrb_ensure()` and `mrb_rescue()` functions. If you need to handle exceptions from C functions, use those functions above.
2020-10-12Add a new function `mrb_exc_protect()`.Yukihiro "Matz" Matsumoto
`mrb_exc_protect()` takes two C functions, `body` to be executed first, and `resc` to be executed when an error happens during `body` execution. Since `mrb_exc_protect()` should be compiled with the proper compiler, we will not see the problem like #5088 that was caused by `setjmp()` and `throw` mixture.
2020-10-12No need to get the `irep` record size twice.Yukihiro "Matz" Matsumoto
2020-10-12Update `MRB_FLOAT_FMT` to always use double precision.Yukihiro "Matz" Matsumoto
2020-10-12Remove the length of `Float' pool from the binary dump.Yukihiro "Matz" Matsumoto
Also fixed the size calculation of `irep` dump, that could cause memory corruption.
2020-10-12Remove `DEBUG_ONLY_EXPR()` from `CHECKPOINT_*` macros; ref #5060Yukihiro "Matz" Matsumoto
To allow C++ compilation. Fix suggested by @dearblue.
2020-10-12Unify `mrb_str_to_str` to `mrb_obj_as_string`.Yukihiro "Matz" Matsumoto
Redirect `mrb_str_to_str` to `mrb_obj_as_string` via C macro. Inspired by #5082
2020-10-12Dump/load 16 bits for `ilen` and `slen` in `irep`.Yukihiro "Matz" Matsumoto
Those types are `uint16_t` in definition. Also we no longer need padding for `iseq`.
2020-10-12Should use `PRId32` to dump `.i32`; ref #5084Yukihiro "Matz" Matsumoto
The fix was proposed by @dearblue
2020-10-12Use `NULL` instead of `0`; close #2467Yukihiro "Matz" Matsumoto
The PR was from @cubicdaiya.
2020-10-12Restore old function names for compatibility; ref #5070Yukihiro "Matz" Matsumoto
- `mrb_check_intern()` to return `mrb_value` - `mrb_intern_check()` to return `mrb_sym` [NEW] Other new functions: - `mrb_intern_check_cstr()` - `mrb_intern_check_str()`
2020-10-12Restore old function names for compatibility; fix #5070Yukihiro "Matz" Matsumoto
Rename new functions: - `mrb_convert_type(mrb,val,type,tname,method)` => `mrb_type_convert(mrb,val,type,tname,method)` - `mrb_check_convert_type(mrb,val,type,tname,method)` => `mrb_type_convert_check(mrb,val,type,tname,method)` Old names are defined by macros (support `tname` drop and `char*` => `mrb_sym` conversion).
2020-10-12Fix warning from VC regarding implicit int conversion.Yukihiro "Matz" Matsumoto
2020-10-12Avoid `unsigned int`; Use `mrb_int` instead.Yukihiro "Matz" Matsumoto
2020-10-12Use `mrb_int` extensively instead of `int`.Yukihiro "Matz" Matsumoto
The mixture causes warnings on 64 bit Windows (VC).
2020-10-12Use `goto` to avoid problems with `DIRECT_THREADED`.Yukihiro "Matz" Matsumoto
You can now use `NEXT` within `switch` statement like 7c087eb.
2020-10-12Extract `div` code in VM and make them shared by `div` methods.Yukihiro "Matz" Matsumoto
2020-10-12Don't use `NEXT` within `switch` statement.Yukihiro "Matz" Matsumoto
On non-`gcc` compatible environment, `NEXT` is translated to `break`.
2020-10-12Better malloc_trim define nameRory OConnell
2020-10-12Add call to malloc_trim on a full GCRory OConnell
2020-10-12Remove obsolete `MRB_WITHOUT_FLOAT` macro from `numeric.c`.Yukihiro "Matz" Matsumoto
2020-10-12Change some `int` variables to `mrb_int`.Yukihiro "Matz" Matsumoto
To silence some warnings. This change cancels part of 7ef3604134.
2020-10-12Update `mrb_get_args()` keyword argument support [incompatible]Yukihiro "Matz" Matsumoto
* `mrb_kwargs` structure reordered (`values` and `rest` come last) * take symbols instead of C `char*`
2020-10-12Separate jump destination check in `OP_R_RETURN`.Yukihiro "Matz" Matsumoto
In the past code, the current `callinfo (ci)` was modified, thus it was possible to pop `ci` beyond the `cibase`, that could cause out of memory bound access for the code like the following: ```ruby def m2 lambda { Proc.new { return :return # return from the method } }.call.call :never_reached end p m2 ```
2020-10-12Make the scope of `const struct RProc *dst` narrower.Yukihiro "Matz" Matsumoto
2020-10-12Redefine `CHECKPOINT_*` macros.Yukihiro "Matz" Matsumoto
By definition `mrb_assert()` called only when `MRB_DEBUG` is defined too. But make I wanted to make clear that the local variable `current_checkpoint_tag` is only accessed when `MRB_DEBUG` is set by wrapping with `DEBUG_ONLY_EXPR()`.
2020-10-12Include `mruby/endian.h` only when `MRB_NO_FLOAT` is undefined.Yukihiro "Matz" Matsumoto
2020-10-12Abandon packing all lower case symbols with 6 characters.Yukihiro "Matz" Matsumoto
To make packed inline symbols within 31 bits, because the new method hash tables allows only 31 bits of symbols. They use top 1 bit to maek unused slots.
2020-10-12Add `U` prefix for `mrb_sym` dump.Yukihiro "Matz" Matsumoto
Since `%u` of `mrb_sym` may be its MSB turned on.
2020-10-12Don't compare `int' with `size_t` (from `sizeof()`).Yukihiro "Matz" Matsumoto
2020-10-12Silence warnings from implicit integer conversions.Yukihiro "Matz" Matsumoto
Caused from combination of `mrb_int`, `int` and `size_t`..
2020-10-12Change float representation in `mrb` binary files.Yukihiro "Matz" Matsumoto
From human readable (ASCII) string representation to binary dump of IEEE754 in little endian.
2020-10-12Replace the implementation of method tables in classes/modules.Yukihiro "Matz" Matsumoto
They are basically the copy of instance variable tables. On my Linux box, memory consumption of `mrbtest` measured by `valgrind` is: - old: 17,683,830 bytes - new: 14,283,749 bytes
2020-10-12Stop warning on 64 bit platforms.Yukihiro "Matz" Matsumoto
2020-10-12Raname `mrb_exc_new_str_lit()` to `mrb_exc_new_lit()`.Yukihiro "Matz" Matsumoto
It uses `mrb_str_new_lit()` internally, but it doesn't need to express it in the name of the function (macro).
2020-10-12Handle potential overflow in `int_div` and `flo_idiv`.Yukihiro "Matz" Matsumoto