| Age | Commit message (Collapse) | Author |
|
- `mrb_convert_type`
- `mrb_check_convert_type`
Those function no longer take `tname` string representation of desired
type, and take method symbols instead of `const char*` names. This is
incompatible change. I hope no third-party gems use those functions.
|
|
|
|
- mrb_define_class_id
- mrb_define_module_id
- mrb_define_method_id
- mrb_define_singleton_method_id
- mrb_define_module_function_id
- mrb_define_const_id
- mrb_undef_method_id
- mrb_undef_class_method_id
- mrb_class_defined_id
- mrb_class_get_id
- mrb_class_defined_under_id
- mrb_class_get_under_id
- mrb_module_get_id
- mrb_module_get_under_id
- mrb_define_class_under_id
- mrb_define_module_under_id
- mrb_exc_get_id
|
|
- :
|
|
Except for support files e.g. `mruby-test/driver.c`, which are not
target of symbol collection via `rake gensym`.
|
|
`mrb_funcall_id()` takes `mrb_sym` instead of `char*` for a method name.
You can use `MRB_SYM()`/`MRB_QSYM()` to specify the method to call.
|
|
|
|
Where `QSYM` means quoted symbols, which cannot be represented C
symbols, so specify aliases instead.
- operators: name of the operation, e.g. add for `+`
- predicates: add `_p` suffix instead of `?`
- bang methods: add `_b` suffix instead of `!`
- instance variables: add `a_` prefix instead of `@`
- global variables: add `d_` prefix instead of `@`
- class variables: unsupported; don't use them
|
|
|
|
For example, `MRB_OPSYM(add)` refers a symbol for `+`.
|
|
|
|
|
|
|
|
|
|
Fixed inproper argument of mrb_fixnum_value() called in integral_div(),
when built with MRB_WITHOUT_FLOAT flag.
Co-authored-by: taiyoslime <[email protected]>
Co-authored-by: n4o847 <[email protected]>
|
|
- The `s` specifier is a string pointer obtained without performing `mrb_str_modify()`, so it cannot be changed.
- The `z` specifier cannot be changed because it is a string pointer obtained by `RSTRING_CSTR()` which returns `const char *`.
|
|
since mrb_str_to_str() also does it.
|
|
|
|
Reported by @shuujii.
|
|
Should have handled the case `to_a` returns `nil`.
|
|
|
|
|
|
|
|
|
|
|
|
Note that the home brew version of `mrb_static_assert` only works within
the function body. This reverts commit 8f99689.
|
|
|
|
|
|
|
|
|
|
|
|
Extend the `cipush()` and `cipop()` functions
|
|
|
|
- Returns the updated call info.
- Unify the processing around `cipush()`.
- `cipop()` restores the stack.
|
|
Use type tag for hash code in `ht_hash_func()`
|
|
The function corresponding to `ht_hash_func()` was as follows in the days of
khash implementation (before d78acc7a).
```c
mrb_hash_ht_hash_func(mrb_state *mrb, mrb_value key)
{
enum mrb_vtype t = mrb_type(key);
...
switch (t) {
...
default:
hv = mrb_funcall(mrb, key, "hash", 0);
h = (khint_t)t ^ (khint_t)mrb_fixnum(hv);
break;
}
...
}
```
When switched to the segmented list implementation (d78acc7a), this function
was changed as follows.
```c
sg_hash_func(mrb_state *mrb, seglist *t, mrb_value key)
{
enum mrb_vtype tt = mrb_type(key);
...
switch (tt) {
...
default:
hv = mrb_funcall(mrb, key, "hash", 0);
h = (size_t)t ^ (size_t)mrb_fixnum(hv);
break;
}
...
}
```
Since the argument `t` was added, the variable for type tag was changed from
`t` to `tt`, but the variable used in the expression of `h` remained `t`.
Probably this is an omission of change, so fixed it.
|
|
|
|
Improve `mruby-os-memsize`
|
|
If it qualify a return type that is not a pointer with `const`, the
compiler ignores it.
|
|
And, in the calculation of the instance variable size, the fraction was
always rounded down because of division of integers, so fix it.
At the same time, test items that are no longer passed due to this
change are deleted.
|
|
It happens when a hash made empty calls `rehash`.
|
|
|
|
To make debugging easy, and to improve the performance little bit.
|
|
The responsibility moved to caller to avoid confusion. Currently the
function is called from only 2 places, so it is relatively easy to
ensure not to update `gray_list` in the caller. But the assumption
may change in the future.
|
|
`mrb_ary_modify` calls `mrb_write_barrier`, so can cause the same
problem of the past `push`. It is provided for use-level API.
|
|
When the array is very big, the simpler `mrb_write_barrier` causes
calling `gc_mark_children` for big arrays repeatedly. That would hinder
performance very badly.
|
|
|
|
|
|
|
|
`C` retrieves a `mrb_value` that refers a class/module.
`c` retrieves a `struct RClass*` pointer to a class/module.
|