Commit Graph

14250 Commits

Author SHA1 Message Date
Yukihiro "Matz" Matsumoto a04b09d535 Merge pull request #5796 from dearblue/bigint-readme
Small improves for `mrbgems/mruby-bigint/README.md` [ci skip]
2022-09-22 10:53:57 +09:00
dearblue b7069dba41 Small improves for mrbgems/mruby-bigint/README.md [ci skip]
- Add a period at the end of the line because markdown will combine lines if there are no blank lines.
- Enable link to `README-fgmp.md`.
2022-09-21 22:50:47 +09:00
Yukihiro "Matz" Matsumoto 07470eb538 mruby-exit.c: make exit() to raise SystemExit exception.
Now it allows error handlers to work, unlike `exit!`.
2022-09-21 22:37:23 +09:00
Yukihiro "Matz" Matsumoto 11504318b8 string-ext/string.rb: String#prepend to take multiple arguments. 2022-09-20 18:31:04 +09:00
Yukihiro "Matz" Matsumoto 4cba1b49c0 string-ext/string.c: String#concat to take multiple arguments. 2022-09-20 18:26:23 +09:00
Yukihiro "Matz" Matsumoto a4099ff776 enum-ext/enum.rb: add Enumerable#sum 2022-09-19 12:31:11 +09:00
Yukihiro "Matz" Matsumoto 81f98a3925 vm.c (cipop): check type of the callinfo::blk; fix #5791
Since `callinfo::blk` is not marked in the GC, it may be reclaimed in
the sweep phase. When it reclaimed, it will become either (a) a non Proc
object, or (b) a Proc object that happen to have the same address.

For case (a), adding `b->tt == MRB_TT_PROC` check works. We should avoid
the following `MRB_PROC_STRICT_P()` and `MRB_PROC_ENV()` operations for
non Proc objects.

For case (b), `MRB_PROC_ENV(b) == CI_ENV(&c->ci[-1])` check should work.
Unrelated Proc objects should be filtered by the check.

We don't need to clear `callinfo::blk` by `NULL` because the callinfo
struct will be discarded afterward in the `cipop()` function.
2022-09-19 08:35:36 +09:00
Yukihiro "Matz" Matsumoto 5b62fbc0fc array.c (mrb_ary_concat_m): Array#concat to take multiple arguments. 2022-09-19 08:25:00 +09:00
Yukihiro "Matz" Matsumoto 9caa4d642c errno.rb: fixed a typo. 2022-09-18 08:01:07 +09:00
Yukihiro "Matz" Matsumoto 3d125aeb89 errno.c (mrb_exxx_init): simplify the function.
Code duplication with mrb_sce_init has been unified.
2022-09-18 07:59:36 +09:00
Yukihiro "Matz" Matsumoto db536da412 errno.c (mrb_sce_sys_fail): SystemCallError may be overridden; fix #5793 2022-09-18 00:07:28 +09:00
Yukihiro "Matz" Matsumoto a5d7326eaa Merge pull request #5795 from jbampton/pre-commit-autoupdate
pre-commit autoupdate, fix spelling, update codespell.txt
2022-09-18 00:06:36 +09:00
John Bampton 2990aaa343 pre-commit autoupdate, fix spelling, update codespell.txt
https://pre-commit.com/#pre-commit-autoupdate
2022-09-18 00:22:55 +10:00
Yukihiro "Matz" Matsumoto 71d5cae016 Merge pull request #5792 from dearblue/stderr
Retrieve the `StandardError` class from `mrb_state`
2022-09-17 22:48:50 +09:00
Yukihiro "Matz" Matsumoto dd5a9f74d8 Merge pull request #5794 from jbampton/fix-makefile
Fix Makefile. Change `lint` to `check`
2022-09-17 22:45:38 +09:00
John Bampton d0ba1fb3ca Fix Makefile. Change lint to check 2022-09-17 23:23:35 +10:00
dearblue 50ea98e76d Retrieve the StandardError class from mrb_state 2022-09-17 22:03:52 +09:00
Yukihiro "Matz" Matsumoto a9d0e9a412 Makefile,Rakefile: rename lint target to check; #5790
The pre-commit check does some static analysis but the term lint is used
as static analysis of software code under the UNIX environment. So we
have renamed the target `check`.
2022-09-17 16:44:24 +09:00
Yukihiro "Matz" Matsumoto 52b2e12f07 numeric_ext.c: implement Integer#digits method.
Which is added in Ruby 2.4.
2022-09-17 16:43:06 +09:00
Yukihiro "Matz" Matsumoto bd1310c9f9 gc.c (incremental_gc_finish): rename the function.
incremental_gc_until() are always called with MRB_GC_STATE_ROOT.
So no need to supply it from outside.
2022-09-17 16:43:06 +09:00
Yukihiro "Matz" Matsumoto b774a004a0 Merge pull request #5790 from jbampton/add-lint-target-to-make
Add `lint` target to the Makefile
2022-09-17 16:41:16 +09:00
John Bampton b466271f16 Add lint target to the Makefile
Add `lint` task to the Rakefile

Runs `pre-commit run --all-files`
2022-09-16 13:26:25 +10:00
Yukihiro "Matz" Matsumoto 74b8bbd8b3 TODO.md: update [ci skip]
Remove bigint entry that we have implemented finally.
2022-09-15 06:43:11 +09:00
Yukihiro "Matz" Matsumoto 97a419f540 gc.c (clear_error_object): need to mark class of error objects; ref #5789 2022-09-13 22:20:34 +09:00
Yukihiro "Matz" Matsumoto b5677bff1f gc.c (final_marking_phase): clear error objects before sweep; close #5789
Some error objects are referenced from `mrb_state`, and previously they
are simply marked as root objects. But when they are not referenced from
other part of the program, they are no longer used at the current incarnation.
That means we can safely reclaim their child objects (their messages and
backtrace information).
2022-09-13 07:16:38 +09:00
Yukihiro "Matz" Matsumoto b716bf005e mruby-range-ext/range.c: use the reference from mrb structure.
Avoid `mrb_class_get()` if possible.
2022-09-12 10:29:45 +09:00
Yukihiro "Matz" Matsumoto d72d26afcb mruby-string-ext/string.c: use the reference from mrb structure. 2022-09-12 10:27:31 +09:00
Yukihiro "Matz" Matsumoto 3662d3d9da fixup! numeric_ext.c: use the reference from mrb structure. 2022-09-12 10:27:30 +09:00
Yukihiro "Matz" Matsumoto fc85523cf1 numeric_ext.c: use the reference from mrb structure. 2022-09-12 10:27:29 +09:00
Yukihiro "Matz" Matsumoto f05574606e mruby-numeric-ext: add ceildiv test with Float and Rational. 2022-09-12 10:27:29 +09:00
Yukihiro "Matz" Matsumoto b6d7564846 numeric_ext.rb: add Integer#ceildiv. 2022-09-12 10:27:28 +09:00
Yukihiro "Matz" Matsumoto ed28547553 doc/guides/mrbconf.md: updates. 2022-09-12 10:27:27 +09:00
Yukihiro "Matz" Matsumoto 3d26993458 AUTHORS: update entries [ci skip] 2022-09-06 13:49:30 +09:00
Yukihiro "Matz" Matsumoto b06fef65ea mruby-exit.c: add reference to exit method.
Currently `exit` works as `exit!` (no handler). It should be fixed
soon.
2022-09-05 23:36:04 +09:00
Yukihiro "Matz" Matsumoto d508c94f0e mruby-exit.c: add exit! method. 2022-09-05 23:35:37 +09:00
Yukihiro "Matz" Matsumoto 6ff00810c6 Merge pull request #5788 from ksss/patch-1
Fix doc for limitation
2022-09-05 14:46:24 +09:00
Yuki Kurihara 9d6cb6ecff Fix doc for limitation
`binding` has been supported since 3.1.0.
2022-09-05 12:12:37 +09:00
Yukihiro "Matz" Matsumoto 966d90e182 src/readfloat.c: renamed from readflt.c 2022-09-05 07:30:13 +09:00
Yukihiro "Matz" Matsumoto 4669d43f50 error.h: move rbreak_tag definitions to src/vm.c. 2022-09-05 07:30:12 +09:00
Yukihiro "Matz" Matsumoto bf16315b70 mruby-exit/exit.c: add fallback definition of constants.
- EXIT_SUCCESS
- EXIT_FAILURE
2022-09-05 07:30:12 +09:00
Yukihiro "Matz" Matsumoto 9f47f11abd math.c: update prototype style. 2022-09-05 07:30:12 +09:00
Yukihiro "Matz" Matsumoto 0cc361990c Merge pull request #5787 from dearblue/count_objects
Improves `ObjectSpace.count_objects`
2022-09-05 07:30:03 +09:00
dearblue c123c49ac4 Improves ObjectSpace.count_objects
- Support for `MRB_TT_STRUCT`, `MRB_TT_BREAK` and `MRB_TT_BIGINT`.
- Performs symbol value embedding with `MRB_SYM()`.
2022-09-04 20:53:18 +09:00
Yukihiro "Matz" Matsumoto eecb6cc080 vm.c (cipush): push block information in the callinfoa; fix #5786 2022-09-01 18:57:19 +09:00
Yukihiro "Matz" Matsumoto 4f0679bb86 pack.c (pack_unpack): small refactoring. 2022-08-31 23:29:12 +09:00
Yukihiro "Matz" Matsumoto 3643f067c2 proc.h: remove unused env flags.
- MRB_ENV_TOUCHED
- MRB_ENV_HEAPED
2022-08-31 07:27:14 +09:00
Yukihiro "Matz" Matsumoto 15e9b09bef pack.c (hex2int): should return signed integer. 2022-08-30 18:08:05 +09:00
Yukihiro "Matz" Matsumoto 0645c4536b readflt.c: small style modifications. 2022-08-29 15:14:46 +09:00
Yukihiro "Matz" Matsumoto dfeda0acc8 random.c: remove Random::DEFAULT. 2022-08-28 08:01:59 +09:00
Yukihiro "Matz" Matsumoto 8c1b2ee0bb numeric_ext.c (int_powm): avoid integer overflow by modulo first.
We do not fall back to big integer calculation unless absolutely necessary.
2022-08-27 22:18:38 +09:00