| Age | Commit message (Collapse) | Author |
|
The default implementations of type predicate macros use `mrb_type`.
But `mrb_type` with `MRB_WORD_BOXING` isn't very efficient, so the new
implementations avoid `mrb_type`.
|
|
linked programs
In lld linked programs, .rodata comes before .text, thus mrb_ro_data_p
will return false for strings in .rodata. Change the lower bound from
_etext to __ehdr_start to catch these cases. This works for ld.bfd, gold
and lld, and it does not have false positives even if .init_array does
not exist.
Remove the branch that uses _edata: strings in .data can be modified so
this is semantically incorrect. Delete the __APPLE__ branch (its
manpages say get_etext() and get_edata() are strongly discouraged).
.init_array has been adopted by most ELF platforms to supersede .ctors.
Neither _etext nor _edata is used, so rename MRB_USE_ETEXT_EDATA to
MRB_USE_EHDR_START.
|
|
`MRB_METHOD_TABLE_INLINE` was fragile. It requires `-falign-functions=n`.
On platform that uses higher bits of function pointers, you can use new
`MRB_METHOD_T_STRUCT` configuration macro.
|
|
This is partial `aspec` check that only checks `MRB_ARGS_NONE()`.
|
|
|
|
So you don't need `-falign-functions=2` anymore. Instead your platform
must not use higher bits of the pointer (true for most platforms).
If not, you have to use `struct mrb_method_t` version.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This change increases the max length of lower inline symbols to 5 bytes.
|
|
The changes at b2c3d88f were inappropriate because the memory layout of bit
fields are implementation defined. Therefor, I fixed it not to use bit
fields.
|
|
|
|
|
|
|
|
The default implementation of `mrb_immediate_p` uses `mrb_type`. However,
in `MRB_WORD_BOXING`, `mrb_type` has many branches and is inefficient, so
provide an implementation that does not use `mrb_type`.
|
|
|
|
|
|
ref: https://github.com/mruby/mruby/pull/4483#issuecomment-498001736
In this configuration, `tt` of `RBreak::val` is set into `RBreak::flags`.
|
|
Based on code proposed by @dearblue to avoid the warning:
`dereferencing type-punned pointer will break strict-aliasing rules`.
|
|
On 64-bit CPU, there is padding in `RBasic`, so reorder the fields and use
it as buffer of embedded string. This change allows 4 more bytes to be
embedded on 64-bit CPU.
However, an incompatibility will occur if `RString::as::ary` is accessed
directly because `RString` structure has changed.
|
|
When building WebAssembly targets with clang (e.g. wasm32-unknown-unknown), all
symbols are hidden by default. To export a symbol, it must be marked with
__attribute__((visibility(default)))
Rather than detecting this exotic target in mruby, allow MRB_API to be defined
externally.
|
|
Generate doxygen docs for mruby
|
|
|
|
|
|
|
|
|
|
Refactor set/unset string type flags
|
|
Introduce `RSTR_SET_TYPE_FLAG` macro to set the specified string type flag and
clear the others.
|
|
|
|
|
|
* `mrb_vm_define_class`
* `mrb_vm_define_module`
Only functions called from user code requires `MRB_API`.
|
|
The condition to make an embedded string was incorrect. Because there were
several similar codes, extracted into `RSTR_EMBEDDABLE_P` macro.
|
|
Contrary to the name, `mrb_to_str` just checks type, no conversion.
|
|
`mrb_string_value_cstr` and `mrb_string_value_len`: obsolete
`mrb_string_cstr`: new function to retrieve NULL terminated C string
`RSTRING_CSTR`: wrapper macro of `mrb_string_cstr`
|
|
|
|
Normal `TYPED_FIXABLE(f,mrb_float)` does not work on 64bit int from
casting problems. The new approach works well, but assumes two's
complement and IEEE-754 floating point numbers.
|
|
Functions that are called infrequently need not to be inline.
|
|
Unify type of line number to `uint16_t`
|
|
|
|
|
|
|
|
|
|
In #4550, @shuuji proposed the name name `MRB_STR_NO_MULTI_BYTE` for
more precise description. Although I agree that the name name is
correct, but the flag means the string does not contain multi byte UTF-8
characters, i.e. all characters fit in the range of ASCII.
|
|
|
|
shuujii/fix-String-byteslice-with-MRB_UTF8_STRING-and-some-edge-cases
Fix `String#byteslice` with `MRB_UTF8_STRING` and some edge cases
|
|
Example:
$ bin/mruby -e '
p "あa".byteslice(1)
p "bar".byteslice(3)
p "bar".byteslice(4..0)
'
Before this patch:
"a"
""
RangeError (4..0 out of range)
After this patch (same as Ruby):
"\x81"
nil
nil
|
|
shuujii/fix-struct-RRange-overflow-on-32-bit-CPU-with-MRB_NAN_BOXING
Fix `struct RRange` overflow on 32-bit CPU with `MRB_NAN_BOXING`
|