summaryrefslogtreecommitdiffhomepage
AgeCommit message (Collapse)Author
2020-10-12Add call to malloc_trim on a full GCRory OConnell
2020-10-12Add methods for asking about compiler featuresRory 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-12Remove `full-core` from `target/appveyor.rb`.Yukihiro "Matz" Matsumoto
2020-10-12Update `IO#popen` to use keyword arguments instead of `Hash` args.Yukihiro "Matz" Matsumoto
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-12Use `mrb_integer()` instead of `mrb_int()`.Yukihiro "Matz" Matsumoto
`mrb_int()` includes implicit integer conversion, where `mrb_integer()` does not. In this case, we know `obj` is an integer before hand.
2020-10-12Silence warnings from implicit integer conversions.Yukihiro "Matz" Matsumoto
Caused from combination of `mrb_int`, `int` and `size_t`..
2020-10-12Add a new gem: `mruby-catch`.Yukihiro "Matz" Matsumoto
Implements `catch`/`throw` non-local jump inherited from Lisp. `catch([tag]) {|tag| block } -> obj` Example: ``` catch(:foo) { 123 } # => 123 catch(:foo) { throw(:foo, 456) } # => 456 catch(:foo) { throw(:foo) } # => nil ```
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 integer overflow in `rational_s_new`.Yukihiro "Matz" Matsumoto
2020-10-12Handle potential overflow in `int_div` and `flo_idiv`.Yukihiro "Matz" Matsumoto
2020-10-12Use `mrb_int_value()` instead of `mrb_fixnum_value()`.Yukihiro "Matz" Matsumoto
Where fixnum overflow can happen.
2020-10-12Add `MRB_NAN_BOXING` for `boxing` target.Yukihiro "Matz" Matsumoto
2020-10-12Add `mrb_integer()` definition for `MRB_NAN_BOXING`.Yukihiro "Matz" Matsumoto
2020-10-12Update `mruby-random` gem to support 32 bit platforms.Yukihiro "Matz" Matsumoto
`sizeof(rand_state)` had been bigger than `sizeof(void*)*3`. Changed random number generator to `Xorshift96` on 32 bit platforms.
2020-10-12Reorganize `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-12Remove unnecessary assignment in String#upton4o847
Co-authored-by: taiyoslime <[email protected]> Co-authored-by: smallkirby <[email protected]>
2020-10-12Update build process for both host and cross compile.Yukihiro "Matz" Matsumoto
2020-10-12Describe the need for `-o` option if multi files given.Yukihiro "Matz" Matsumoto
2020-10-12Update usage description of `mrbc`.Yukihiro "Matz" Matsumoto
2020-10-12Update `Rakefile`.Yukihiro "Matz" Matsumoto
So that you can omit `host` target. Now `host-debug` works.
2020-10-12"backport" CRuby r46756; ref #3500Yukihiro "Matz" Matsumoto
Based on cremno/mruby@6bd0119
2020-10-12Change the return type of `mrb_check_intern()` and friends.Yukihiro "Matz" Matsumoto
They used to return `mrb_value` but now return `mrb_sym` for consistency with other `intern` functions. If symbols are not defined, `check` functions return `0`, instead of `nil` in the past. It causes API incompatibility but I believe few people use those functions out of the core, and those changes are very easy to handle, hopefully.
2020-10-12Avoid using `mrb_check_intern_str()`.Yukihiro "Matz" Matsumoto
We call `mrb_intern_str()` later anyway, so there's no need to avoid defining a new symbol here.
2020-10-12"backport" CRuby r46656; #2500Yukihiro "Matz" Matsumoto
Based on cremno/mruby@d446192
2020-10-12Remove `MRB_NO_FLOAT_INLINE` and `MRB_WBOX_FLOAT_INLINE` configuration.Yukihiro "Matz" Matsumoto
They are not used from the beginning.
2020-10-12Fixed ISO section numbers in `test/t/superclass.rb`.Yukihiro "Matz" Matsumoto
2020-10-12Make division by zero cause `ZeroDivisionError`.Yukihiro "Matz" Matsumoto
As described in ISO 15.2.30.
2020-10-12Fixed wrong size calculation for `memsize_of()`.Yukihiro "Matz" Matsumoto
2020-10-12Rename `MRB_TT_FIXNUM` to `MRB_TT_INTEGER`.Yukihiro "Matz" Matsumoto
We still have `#define MRB_TT_FIXNUM MRB_TT_INTEGER` for compatibility.
2020-10-12change linkage to internalcremno
2020-10-12define sprintf and format as global functionscremno
2020-10-12move mrbgem initialization into sprintf.ccremno
Also remove some unnecessary code.
2020-10-12Add tests for CRuby bug #9982cremno
https://bugs.ruby-lang.org/issues/9982
2020-10-12Always add trailing `.0` in `Float#inspect`; ref #4225KOBAYASHI Shuji
Trailing `.0` is removed from `Float#to_s` and `Float#inspect` at 9d08025b. However, I think the more human-readable format is better for `Float#inspect`. For example, in the `Float#to_s` format, the failure message is not well understood when testing values including types by `eql?` (e.g. `Numeric#step` test). ```ruby assert "example" do exp = 1.0 act = 1 assert_operator(exp, :eql?, act) #=> Expected 1 to be eql? 1. end ```
2020-10-12Rename `mruby_version` in the lockfile to `mruby`; close #4658Yukihiro "Matz" Matsumoto
2020-10-12Integrate `Fixnum` class into `Integer` classdearblue
* The `Fixnum` constant is now an alias for the `Integer` class. * Remove `struct mrb_state::fixnum_class` member. If necessary, use `struct mrb_state::integer_class` instead.
2020-10-12Fix `Fixnum` and `Float` comparison in `Hash` lookupKOBAYASHI Shuji
```console $ bin/mruby -e 'p({1 => 2}.key?(1.0))' true ``` ```console $ bin/mruby -e 'p({1 => 2}.key?(1.0))' false ```