Yukihiro "Matz" Matsumoto
ea649e70b8
mruby-pack/pack.c (mrb_pack_pack): use direct array buffer access
...
We don't need index wrap-around not boundary check here, so we can use
faster direct array access.
2023-06-29 22:54:58 +09:00
Yukihiro "Matz" Matsumoto
0c4f5a4093
backtrace.c (mrb_unpack_backtrace): make the function static
2023-06-29 22:54:09 +09:00
Yukihiro "Matz" Matsumoto
e563a3cb2c
backtrace.c (packed_backtrace): reduce unnecessary calls
...
Instead of calling each_backtrace() twice, use a new function
count_backtrace().
2023-06-28 21:53:17 +09:00
Yukihiro "Matz" Matsumoto
f1d6af08cf
gc.c: inline heap page linkage
2023-06-27 15:48:33 +09:00
Yukihiro "Matz" Matsumoto
38b9a25e83
gc.c (mrb_obj_alloc): remove free_next,free_prev from heap pages
...
It used to be maintain heap pages with allocatable objects (free_heaps)
but we can save two words (16 bytes) per page by scanning live heap pages.
2023-06-27 15:48:25 +09:00
Yukihiro "Matz" Matsumoto
695ad6ea95
gc.c (incremental_sweep_phase): freed need not to be smaller than page size
2023-06-26 17:14:43 +09:00
Yukihiro "Matz" Matsumoto
b2110c23a1
Merge pull request #6023 from dearblue/expose-headers
...
"expose_header_files" task split per build
2023-06-24 15:35:31 +09:00
Yukihiro "Matz" Matsumoto
a3365d8b3f
gc.c (obj_free): need not to unshare env object when freeing fibers
...
Since when env objects reference the context, we no longer need to
unshare (stack reallocate) env objects. Currently all env objects
referenced from fibers are already recycled, so we removed unnecessary
code altogether.
2023-06-23 23:06:15 +09:00
Yukihiro "Matz" Matsumoto
fc9fffc5b5
kernel.rb (_inspect): _inspect method no longer needed
2023-06-22 23:32:31 +09:00
Yukihiro "Matz" Matsumoto
6ae6b63aaf
mruby-struct: add recursive inspect check instead of _inspect hack
2023-06-22 12:53:51 +09:00
Yukihiro "Matz" Matsumoto
849963b81e
variable.c (mrb_obj_iv_inspect): support recursion detection
2023-06-21 23:36:59 +09:00
Yukihiro "Matz" Matsumoto
0713f2a840
mruby-set/set.rb (inspect): add recursive inspect check to Set#inspect
2023-06-20 11:25:49 +09:00
Yukihiro "Matz" Matsumoto
113565a1c5
hash.c (mrb_hash_to_s): add recursive inspect check to Hash#inspect
2023-06-20 11:18:38 +09:00
Yukihiro "Matz" Matsumoto
5cb0c7463b
array.c (mrb_ary_to_s): add recursive check to Array#inspect
2023-06-20 07:06:33 +09:00
Yukihiro "Matz" Matsumoto
e2bbf75d58
kernel.c: prepare for new recursive inspect check
...
Like previous recursive `<=>` check, scan call stack to detect recursive
`inspect` calls. We no longer need incomplete `_inspect` hack to pass
around a hash table to record objects currently inspecting.
2023-06-20 07:04:28 +09:00
Yukihiro "Matz" Matsumoto
75c8ffddf5
object.c (mrb_equal) move mrb_equal() back to object.c
2023-06-20 06:45:05 +09:00
Yukihiro "Matz" Matsumoto
89a1719a13
compar.rb: use equal?() instead of ==
...
To avoid unnecessary infinite recursion.
2023-06-19 15:33:13 +09:00
dearblue
fdec32a8f2
"expose_header_files" task split per build
...
If there are multiple build targets, it should be preferable to have the task processed at each of them.
2023-06-18 21:22:31 +09:00
Yukihiro "Matz" Matsumoto
7f85ae2c48
Merge pull request #6022 from chasonr/msdos-build
...
Build configuration for MS-DOS and DJGPP
2023-06-18 18:13:24 +09:00
Ray Chason
23e9befbc0
Changes to cross-compile with DJGPP
2023-06-17 17:20:33 -04:00
Ray Chason
853b25972e
Build configuration for MS-DOS
2023-06-17 17:20:20 -04:00
Yukihiro "Matz" Matsumoto
a638a71c72
test/hash.rb: remove some inspect/to_s tests
...
CRuby does prohibits Hash modification during iteration, so remove those
self modifying inspect/to_s.
2023-06-17 17:56:41 +09:00
Yukihiro "Matz" Matsumoto
20552fe176
hash.c (mrb_hash_foreach): wrap function call with h_check_modified
...
If the iterating hash is modified in the function, h_each loop may
crash accessing modified (and probably deallocated) internal data.
2023-06-17 10:55:55 +09:00
Yukihiro "Matz" Matsumoto
e502fd88b9
kernel.c (mrb_cmp_m): check recursive <=> calls
...
If previous `<=>` method invocation with same arguments is detected in
the stack trace, this `<=>` call must be recursive and can cause stack
overflow.
2023-06-17 09:18:55 +09:00
Yukihiro "Matz" Matsumoto
7c9cb0901c
kernel.c (mrb_equal): simplify the code
2023-06-16 13:45:58 +09:00
Yukihiro "Matz" Matsumoto
5e4cecf766
internal.h: add mrb_obj_equal_m to internal.h
2023-06-15 23:36:27 +09:00
Yukihiro "Matz" Matsumoto
a04d18bb6d
kernel.c (mrb_eqq_m): rename function equal -> eqq
...
This function implements `Kernel#===` and it's usually abbreviated to
`eqq` not `equal`.
2023-06-15 23:32:41 +09:00
Yukihiro "Matz" Matsumoto
359c630d73
kernel.c (mrb_equal): move mrb_equal() from object.c
2023-06-15 23:31:45 +09:00
Yukihiro "Matz" Matsumoto
2be7cba8f5
kernel.c (obj_respond_to): refactoring
...
- skip basic_obj_respond_to(); call mrb_respond_to() directly
- narrower scope for `mrb_sym rtm_id`
- use mrb_func_basic_p() to detect override
- use mrb_funcall_id() to avoid local mrb_value array
2023-06-14 11:41:21 +09:00
Yukihiro "Matz" Matsumoto
347586e400
kernel.c: define respond_to_missing? method
2023-06-14 11:31:55 +09:00
Yukihiro "Matz" Matsumoto
e96d90dab2
Merge pull request #6017 from jbampton/standardize-pre-commit-config
...
Standardize the `pre-commit` config
2023-06-13 15:44:51 +09:00
Yukihiro "Matz" Matsumoto
7125481952
Merge pull request #6021 from jbampton/news-remove-duplicate-cve
...
NEWS: remove duplicate CVE from list
2023-06-13 14:09:59 +09:00
John Bampton
26659ef76c
NEWS: remove duplicate CVE from list
2023-06-13 15:02:57 +10:00
Yukihiro "Matz" Matsumoto
0d863ae85f
Merge pull request #6018 from jbampton/configure-dependabot-for-bundler
...
Configure Dependabot updates for Bundler/Ruby
2023-06-13 13:50:40 +09:00
Yukihiro "Matz" Matsumoto
c99403d635
Merge pull request #6020 from jbampton/fix-markdown-link
...
Enable markdownlint rule MD052
2023-06-13 13:49:49 +09:00
Yukihiro "Matz" Matsumoto
a332ea1f67
Merge pull request #6019 from jbampton/docs-remove-duplicate-cve
...
docs: remove duplicate CVE from list
2023-06-13 13:47:55 +09:00
John Bampton
50e0aad288
Enable markdownlint rule MD052
...
https://github.com/DavidAnson/markdownlint/blob/main/doc/md052.md
2023-06-13 14:34:52 +10:00
John Bampton
343a633fb0
doc: fix Markdown reference links
2023-06-13 14:31:29 +10:00
John Bampton
36f2d1733b
docs: remove duplicate CVE from list
2023-06-13 13:27:23 +10:00
John Bampton
760ce71af0
Configure Dependabot updates for Bundler/Ruby
...
https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/about-dependabot-version-updates#supported-repositories-and-ecosystems
In future this will keep the Gemfile.lock up to date
2023-06-13 12:44:00 +10:00
John Bampton
f14f2ae174
Standardize the pre-commit config
2023-06-13 08:54:17 +10:00
Yukihiro "Matz" Matsumoto
17720c9b7b
variable.c (const_get): avoid mrb_funcall if possible
...
Directly call mrb_const_missing() if const_missing is not overridden.
2023-06-12 23:47:35 +09:00
Yukihiro "Matz" Matsumoto
89f7bb1056
use more lightweight mrb_funcall_argv instead of mrb_funcall_id
2023-06-12 14:22:04 +09:00
Yukihiro "Matz" Matsumoto
39a29a7de1
mruby-bin-debugger/mrbgem.rake: fix defines configuration
...
`spec.build.defines` should be update inline. Otherwise, configuration
may differ from file to file.
2023-06-12 13:07:57 +09:00
Yukihiro "Matz" Matsumoto
a867fb0703
class.c: remove methID from the example and codespell dict
2023-06-09 17:56:21 +09:00
Yukihiro "Matz" Matsumoto
b6181ae58a
mruby/gc.h: reorder mrb_gc members to reduce alignment gaps
2023-06-09 17:19:09 +09:00
Yukihiro "Matz" Matsumoto
727a2ec793
gc.c (obj_free): use simpler is_dead()
...
`mrb_object_dead_p()` is heavier if the pointer is (or used to be) an
object in the heaps.
2023-06-07 17:03:32 +09:00
Yukihiro "Matz" Matsumoto
336b7efb41
gc.c (mrb_incremental_gc): clarify the if-condition
2023-06-06 11:29:48 +09:00
Yukihiro "Matz" Matsumoto
8b8e186688
gc.h: rename majorgc_old_threashold to oldgen_threashold
...
This field means that if you have more old generation objects than
this value, major GC mode will be turned on.
2023-06-06 11:26:35 +09:00
Yukihiro "Matz" Matsumoto
b47c8b738a
gc.c (clear_all_old): fix a generational GC bug
...
This issue was caused by 375d22b that introduced a serious mark
leakage in the generational GC mode.
2023-06-06 07:29:41 +09:00