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
Yukihiro "Matz" Matsumoto
0bb08718b8
gc.c (incremental_marking_phase): clear gcnext for debugging
2023-06-05 23:31:36 +09:00
Yukihiro "Matz" Matsumoto
6958368daa
gc.c (gc_mark_children): declare a loop variable in the for-statement
2023-06-05 23:30:33 +09:00
Yukihiro "Matz" Matsumoto
623cda5521
gc.c: make color macros literals for debugging clarity
2023-06-05 16:00:04 +09:00
Yukihiro "Matz" Matsumoto
93648fc954
gc.c (mrb_env_unshare): fix a write barrier bug
2023-06-02 11:00:13 +09:00
Yukihiro "Matz" Matsumoto
9369679e36
vm.c: reduce local variables
2023-06-01 09:14:39 +09:00
Yukihiro "Matz" Matsumoto
5b61407414
class.c (prepare_singleton_class): defer method table allocation
2023-06-01 09:13:44 +09:00
Yukihiro "Matz" Matsumoto
0d8545e01b
error.c (frozen_error): change specifier from %t to %T
...
- `%t` prints type (class) of the argument
- `%T` prints real class of the argument, skipping TT_ICLASS, etc.
2023-05-31 08:35:54 +09:00
Yukihiro "Matz" Matsumoto
e6c89ef1f9
mruby.h: make mrb_check_frozen to a normal function from inline one
2023-05-31 08:33:58 +09:00
Yukihiro "Matz" Matsumoto
ccdf75c1c2
error.c: a new function mrb_check_frozen_value()
2023-05-31 08:31:13 +09:00
Yukihiro "Matz" Matsumoto
8b39a7825d
Reduce unnecessary mrb_obj_ptr() to mrb_check_frozen()
2023-05-31 08:29:12 +09:00
Yukihiro "Matz" Matsumoto
8873229312
codedump.c: fix indentation of OP_SCLASS
2023-05-30 16:08:38 +09:00
Yukihiro "Matz" Matsumoto
6eedf1065d
numeric.c (flo_idiv): add mrb_check_num_exact
2023-05-30 08:54:44 +09:00
Yukihiro "Matz" Matsumoto
e84060a900
string.c: rename function str_check_too_big -> str_check_length
2023-05-30 08:40:16 +09:00
Yukihiro "Matz" Matsumoto
f813b5d1d8
string.c (str_new): add string length check
2023-05-29 23:18:44 +09:00
Yukihiro "Matz" Matsumoto
aecaaf011f
string.c (mrb_str_resize): refactor string length check
2023-05-29 23:18:19 +09:00
Yukihiro "Matz" Matsumoto
0a6e1c0ffe
class.c (copy_class): copy source flags as well (except frozen flag)
2023-05-29 22:59:05 +09:00
Yukihiro "Matz" Matsumoto
c0c4219b25
class.c (copy_class): avoid copying method table in some cases
...
To prevent memory leaks
2023-05-29 22:57:59 +09:00
Yukihiro "Matz" Matsumoto
e4e3740688
class.c (init_copy): add an assertion
2023-05-29 09:26:45 +09:00
Yukihiro "Matz" Matsumoto
a02894afa3
small cosmetic changes
2023-05-29 09:26:45 +09:00
Yukihiro "Matz" Matsumoto
0ffe9b987a
class.c (mrb_prepend_module): c should not be MRB_TT_ICLASS
2023-05-29 09:26:44 +09:00
Yukihiro "Matz" Matsumoto
7f887f1928
class.c (mrb_class_initialize): check duplicated initialization
2023-05-26 12:48:34 +09:00
Yukihiro "Matz" Matsumoto
2ad3f0e34b
vm.c (mrb_yield_with_class): keep mid of the callee
...
Otherwise `super` from within blocks may call wrong methods.
2023-05-26 11:17:51 +09:00
Yukihiro "Matz" Matsumoto
9040baa270
vm.c (mrb_yield_with_class): avoid redundant initialization of mid
2023-05-26 11:14:58 +09:00
Yukihiro "Matz" Matsumoto
8f745b7728
vm.c (OP_ENTER): fix issues by unreferenced kdict and blk
...
There's short a period where kdict and blk are not pointed from the stack.
2023-05-23 14:54:36 +09:00
Yukihiro "Matz" Matsumoto
2f7f797473
remove extra spaces before ;
2023-05-22 12:05:35 +09:00
Yukihiro "Matz" Matsumoto
f1a3cfbd3b
add a space between if and (
2023-05-22 11:55:21 +09:00
Yukihiro "Matz" Matsumoto
c32f7915fb
reformat else clause indentation style
2023-05-20 00:21:01 +09:00
Yukihiro "Matz" Matsumoto
eea72ec84a
fix spaces in the type cast expressions (cosmetic changes)
2023-05-18 23:29:16 +09:00
Yukihiro "Matz" Matsumoto
cead78b394
variable.c (iv_rehash): fixed removed check
...
This check removed in 70cc2cc was necessary.
2023-05-17 09:52:00 +09:00
Yukihiro "Matz" Matsumoto
5ead26be3d
vm.c (ci_bidx): inline the function if possible
2023-05-16 22:41:32 +09:00
Yukihiro "Matz" Matsumoto
cd276715f8
variable.c: move inline function before usage
2023-05-13 22:52:39 +09:00
Yukihiro "Matz" Matsumoto
077d8ad514
symbol.c (sym_intern): check NUL before calling strlen()
...
To avoid accidental buffer overrun if a string without NUL termination
is provided.
2023-05-02 09:45:47 +09:00
Yukihiro "Matz" Matsumoto
19b2c1c73d
symbol.c: remove unused macro
2023-05-02 09:45:23 +09:00
Yukihiro "Matz" Matsumoto
70cc2cc173
variable.c (iv_rehash): remove unnecessary checks
2023-04-29 23:17:08 +09:00
Yukihiro "Matz" Matsumoto
5024c3453d
variable.c (iv_put): remove NULL check since t must not be NULL
2023-04-27 17:14:48 +09:00
Yukihiro "Matz" Matsumoto
ac7e63ab3b
Merge pull request #5986 from dearblue/bytesplice
...
Fix bugs in `String#bytesplice`
2023-04-17 07:17:00 +09:00
dearblue
0279067dc4
Returns the value of Integer#~ from mrb_bint_rev()
...
fixed #5987
2023-04-15 22:39:05 +09:00
dearblue
8665f88791
Allow an empty string for String#bytesplice
2023-04-15 21:26:01 +09:00
dearblue
59931e95c4
Prohibit string lengths less than 0 in String#bytesplice
2023-04-15 21:26:00 +09:00
dearblue
5bc3a48ecb
Handling negative indices in String#bytesplice
2023-04-15 21:25:59 +09:00
dearblue
dcced0016c
Countermeasure to overflow for String#bytesplice
2023-04-15 21:25:58 +09:00
dearblue
73b6c6619c
Need type check for replace by String#bytesplice
2023-04-15 21:25:57 +09:00
dearblue
2e9ac8f448
Returns self for String#bytesplice
2023-04-15 21:25:56 +09:00
dearblue
d3128ce58a
Allow Class#allocate to be prohibited
...
Calling `Class#allocate` with `UnboundMethod#bind_call` usually succeeds without problems.
If this behavior does not make us happy, we can now prohibit it with `MRB_SET_INSTANCE_TT(klass, MRB_TT_UNDEF)`.
At the same time, it applies to the `Binding`, `Complex`, `Data`, `Float`, `Integer`, `Method`, `Rational` and `UnboundMethod` classes.
2023-04-09 21:14:07 +09:00
Yukihiro "Matz" Matsumoto
64536b866b
string.c (str_escape): simplify the logic
2023-04-07 13:53:19 +09:00
Yukihiro "Matz" Matsumoto
d0653ca908
cdump.c: escape filename debug information; fix #5974
...
Windows path separator is "\" so that it needs to be escaped.
2023-04-07 13:51:59 +09:00