| Age | Commit message (Collapse) | Author |
|
|
|
Otherwise `target_class` can be lost when it differs from `proc`'s
`target_class`, e.g. when called from `instance_eval`.
Also we should not pass `target_class` to `MRB_OBJ_ALLOC` since it
checks instance type from the class, and `target_class` may not have
proper information. ref #5272
|
|
|
|
|
|
|
|
|
|
To reduce number of string allocation.
|
|
Replace them by `mrb_ensure_string_type()`.
|
|
And merged to `mrb_f_integer()` which is only usage of the function.
|
|
They return the checking argument without modification, so the values
are already there. Maybe we should change the return type to `void` but
keep them unchanged for compatibility.
|
|
|
|
Allow `nil` for `c!` and `I!` specifiers of `mrb_get_args()`
|
|
|
|
It is `o`, `C`, `S`, `A` and `H` specifiers that are integrated.
As a side effect, the `C!` Specifier can now be used.
|
|
- Removed the `ARGV` macro.
The current path doesn't go into the mruby VM and there's also no need to separate variables.
- Use common functions to check object types.
- Use `mrb_ensure_string_type()` to check the string instead of `mrb_to_str()`.
This is for consistency with array and hash.
- Use `mrb_ensure_array_type()` to check the array instead of `to_ary()`.
- Use `mrb_ensure_hash_type()` to check the hash instead of `to_hash()`.
- Add and use `ensure_class_type()` to check class and module.
- Changed the argument index type from `mrb_int` to `int`.
Even if it is `int16_t`, it is enough.
`mrb_int` is overkill, especially if `MRB_32BIT` and `MRB_INT64` are defined.
|
|
|
|
`MRB_WORDBOX_USE_HEAP_FLOAT` instead of `MRB_USE_FLOAT_FULL_PRECISION`.
|
|
* use predefined `mrb_ro_data_p()` for user-mode Linux and macOS
* define `MRB_LINK_TIME_RO_DATA_P` if predefined one is used
* configure macro `MRB_USE_LINK_TIME_RO_DATA_P` is no longer used
* contributions for new platforms are welcome
|
|
Checks the frozen object with `mrb_get_args()`
|
|
This now works with the `+` modifier that can be added after each specifier.
- `nil` is bypassed.
- The `s` and `z` specifiers are received in C as a `const char *`, so adding a `+` modifier will raise an exception.
- The `a` specifier is received in C as `const mrb_value *`, so adding a `+` modifier will raise an exception.
- The `|`, `*`, `&`, `?` and `:` specifiers with `+` modifier raises an exception.
If `!`/`+` exceeds one for each specifier, an exception will occur in the subsequent processing.
This is the same behavior as before.
|
|
The previously used `given` variable will be merged into the `pickarg` pointer variable, which points to the argument currently being processed for each loop.
|
|
|
|
- `#include <math.h>` is done in `mruby.h`.
Eliminate the need to worry about the `MRB_NO_FLOAT` macro.
- Include mruby header files before standard header files.
If the standard header file is already placed before `mruby.h`, the standard header file added in the future tends to be placed before `mruby.h`.
This change should some reduce the chances of macros that must be defined becoming undefined in C++ or including problematic header files in a particular mruby build configuration.
|
|
|
|
Embedding reduce memory consumption, sacrificing precision. It clips least
significant 2 bits from `mrb_float`, so if you need to keep float precision,
define `MRB_USE_FLOAT_FULL_PRECISION`.
`MRB_WORD_BOXING` and `MRB_INT64`:
`mrb_float` (`double`) is embedded in `mrb_value` clipped last 2 bits.
`MRB_WORD_BOXING` and `MRB_INT64` and `MRB_USE_FLOAT_FULL_PRECISION`:
`mrb_float` is allocated in the heaps wrapped by `struct RFloat`.
`MRB_WORD_BOXING` and `MRB_INT32` and `MRB_USE_FLOAT32`:
`mrb_float` (`float`) is embedded in `mrb_value` clipped last 2 bits.
In addition, to reserve bit space in the `mrb_value`, maximum inline
symbol length become 4 (instead of 5) in the configuration.
`MRB_WORD_BOXING` and `MRB_INT32`:
Assume `MRB_USE_FLOAT_FULL_PRECISION` and allocate Float values in heap.
|
|
In additions:
* use bitmap for flags
* BER integer compression for length
|
|
|
|
|
|
- mrb_packed_int_len()
- mrb_packed_int_encode()
- mrb_packed_int_decode()
|
|
|
|
Previously, the `I` specifier only checked if the object was `MRB_TT_ISTRUCT`.
So it was at risk of getting pointers to different C structs if multiple classes were to use the `MRB_TT_ISTRUCT` instance.
Change this behavior and change the C argument corresponding to the `I` specifier to `(void *, struct RClass)`.
This change is not compatible with the previous mruby.
Please note that if the user uses the previous specifications, `SIGSEGV` may occur or the machine stack may be destroyed.
resolve #5527
|
|
Fix #5528
This reverts commit 59201b59046b9e73c309508350cd3c0fafd20e4d; #5497
|
|
|
|
Recent peephole optimization made `ADDI/SUBI` destinations possibly
local variables.
|
|
|
|
|
|
`-1 * (1<<63)` causes overflow, but `-1<<63` is a valid value.
|
|
|
|
This reverts commit 3738d62a86a54524d5d7738ddbafe4700ca6a889.
The change changed the behavior with floating point numbers.
|
|
|
|
Use `mrb_fixnum_value()` only when you are absolutely sure that the
value is within `Fixnum` range, i.e. 31 bits signed integer at least.
|
|
The `Fixnum` class is no longer provided by `mruby`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|