| Age | Commit message (Collapse) | Author |
|
- `size_t` is more commonly used.
- `len` argument of `mrb_str_new()` is `size_t`.
NOTE:
The test for `%l` is temporarily disabled because adding a new type to
`mrbgems/mruby-test/vformat.c` causes an error (memory error?) on Visual
Studio 2017 in AppVeyor.
|
|
It potentially not work when `mrb_float` is `float` because `float` variable
in variable length arguments is promoted to `double`.
Also I fixed build with `MRB_WITHOUT_FLOAT`.
|
|
It potentially breaks, for example, in the case of `mrb_int` is 64-bit
and more smaller type is passed by `%d`. In fact, the problem could
become apparent when I used `%d` to `backtrace_location::lineno` in
`src/backtrace.c:mrb_unpack_backtrace()` on AppVeyor.
Therefore, change `%d` for `int` (not `mrb_int`) so that it can be
used mostly without casting.
|
|
Format sequence syntax:
%[modifier]specifier
Modifiers:
----------+------------------------------------------------------------
Modifier | Meaning
----------+------------------------------------------------------------
! | Convert to string by corresponding `inspect` instead of
| corresponding `to_s`.
----------+------------------------------------------------------------
Specifiers:
----------+----------------+--------------------------------------------
Specifier | Argument Type | Note
----------+----------------+--------------------------------------------
c | char |
d,i | mrb_int |
f | mrb_float |
l | char*, mrb_int | Arguments are string and length.
n | mrb_sym |
s | char* | Argument is NUL terminated string.
t | mrb_value | Convert to type (class) of object.
v,S | mrb_value |
C | struct RClass* |
T | mrb_value | Convert to real type (class) of object.
Y | mrb_value | Same as `!v` if argument is `true`, `false`
| | or `nil`, otherwise same as `T`.
% | - | Convert to percent sign itself (no argument
| | taken).
----------+----------------+--------------------------------------------
This change will increase the binary size, but replacing all format strings
with new specifiers/modifiers will decrease the size because it reduces
inline expansion of `mrb_obj_value()`, etc. at the caller.
|
|
`MRB_INT_MIN` is the only integer value that has no corresponding
positive integer value (i.e. `-MRB_INT_MIN` = `MRB_INT_MIN`).
|
|
|
|
|
|
|
|
|
|
Fix `Module#dup` to frozen module
|
|
`String#inspect` can set `MRB_STR_ASCII` flag to receiver and return value
because it checks character byte length.
|
|
|
|
Before this patch:
$ bin/mruby -e 'p Module.new.freeze.dup.frozen?' #=> true
After this patch (same as Ruby):
$ bin/mruby -e 'p Module.new.freeze.dup.frozen?' #=> false
|
|
Use stack memory for small name of attr accessors
|
|
|
|
Functions that are called infrequently need not to be inline.
|
|
|
|
Unify type of line number to `uint16_t`
|
|
shuujii/keep-MRB_STR_ASCII-flag-in-some-methods-of-String
Keep `MRB_STR_ASCII` flag in some methods of `String`
|
|
|
|
|
|
|
|
|
|
Also integrated the common parts of `mrb_mod_attr_reader()` and
`mrb_mod_attr_writer()` functions.
|
|
|
|
|
|
|
|
Based on Boyer-Moore-Horspool algorithm (Quick Search algorithm).
As a side effect, the correct position is returned even if an invalid UTF-8
string is given.
```console
% ./mruby@master -e 'p ("\xd1" * 100 + "#").index("#")'
50
% ./mruby@improve-index -e 'p ("\xd1" * 100 + "#").index("#")'
100
```
The other behavior should be the same as the current implementation.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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.
|
|
This patch is showed in #4549.
|
|
|
|
Before this patch:
$ bin/mruby -e '1.respond_to?(2)' #=> nil is not a symbol
After this patch (same as Ruby):
$ bin/mruby -e '1.respond_to?(2)' #=> 2 is not a symbol nor a string
|
|
|
|
|
|
It is integration with part of argument parsing used in `mrb_str_aset_m()`.
|
|
The purpose is to eliminate string objects that are temporarily created during processing.
|
|
|
|
|
|
mruby/mruby/src/string.c:1722:4: warning: label 'bytes' defined but not used [-Wunused-label]
bytes:
^~~~~
|
|
Change to UTF-8 string reversing with in place
|
|
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
|
|
Fix argument specs to `Array`
|
|
shuujii/compare-obj-pointer-directly-instead-of-using-mrb_obj_eq-in-mrb_gc_unregister
Compare obj pointer directly instead of using mrb_obj_eq in mrb_gc_unregister
|