summaryrefslogtreecommitdiffhomepage
path: root/include
AgeCommit message (Collapse)Author
2019-09-08Optimize `mrb_bool()` with `MRB_WORD_BOXING`KOBAYASHI Shuji
2019-09-07Increase symbol bit size on 32-bit mode with `MRB_WORD_BOXING`KOBAYASHI Shuji
This change increases the max length of lower inline symbols to 5 bytes.
2019-09-06Avoid bit fields in `mrb_value`; ref b2c3d88fKOBAYASHI Shuji
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.
2019-09-02Fix an error in refactoring; fix #4682Yukihiro "Matz" Matsumoto
2019-08-31Fix `mrb_immediate_p(MRB_TT_FREE)` to return `false`; ref #4679Yukihiro "Matz" Matsumoto
2019-08-31Refactor #4662 with different names.Yukihiro "Matz" Matsumoto
2019-08-31Implement `mrb_immediate_p` macro for `MRB_WORD_BOXING`KOBAYASHI Shuji
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`.
2019-08-26fix lots of warnings and make logo not so bigDavid Siaw
2019-08-26change doc directory and reduce warningsDavid Siaw
2019-08-23Fix `RBreak` exceeding 6 words on 32-bit mode w/o boxing and `MRB_USE_FLOAT`KOBAYASHI Shuji
ref: https://github.com/mruby/mruby/pull/4483#issuecomment-498001736 In this configuration, `tt` of `RBreak::val` is set into `RBreak::flags`.
2019-08-20Avoid C++ strict aliasing warning.Yukihiro "Matz" Matsumoto
Based on code proposed by @dearblue to avoid the warning: `dereferencing type-punned pointer will break strict-aliasing rules`.
2019-08-20Use `RBasic` padding for embedded string on 64-bit CPUKOBAYASHI Shuji
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.
2019-08-18Allow external definition of MRB_API macroRyan Lopopolo
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.
2019-08-19Merge pull request #4636 from davidsiaw/doxygenYukihiro "Matz" Matsumoto
Generate doxygen docs for mruby
2019-08-18fix up documentation for valuesDavid Siaw
2019-08-18Prohibit changes to iseq in principledearblue
2019-08-18fix up markdown display in doxygenDavid Siaw
2019-08-18first bit of doc generationDavid Siaw
2019-08-17Merge pull request #4634 from shuujii/refactor-set-unset-string-type-flagsYukihiro "Matz" Matsumoto
Refactor set/unset string type flags
2019-08-17Refactor set/unset string type flagsKOBAYASHI Shuji
Introduce `RSTR_SET_TYPE_FLAG` macro to set the specified string type flag and clear the others.
2019-08-17Resolve conflict between #4582 and C++ warning.Yukihiro "Matz" Matsumoto
2019-08-16Update `struct RArray` union to silence C++ warning.Yukihiro "Matz" Matsumoto
2019-08-14Remove `MRB_API` from functions only called from `vm.c`.Yukihiro "Matz" Matsumoto
* `mrb_vm_define_class` * `mrb_vm_define_module` Only functions called from user code requires `MRB_API`.
2019-08-11`mrb_str_modify_keep_ascii` can embed one more byteKOBAYASHI Shuji
The condition to make an embedded string was incorrect. Because there were several similar codes, extracted into `RSTR_EMBEDDABLE_P` macro.
2019-08-07Update `mrb_to_str` and related functions.Yukihiro "Matz" Matsumoto
Contrary to the name, `mrb_to_str` just checks type, no conversion.
2019-08-07Reorganize `mrb_string_value_cstr` and related functions.Yukihiro "Matz" Matsumoto
`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`
2019-08-04Add constants for floating point numberdearblue
2019-07-22Fix `FIXABLE_FLOAT()` on `MRB_INT64`; ref #4566Yukihiro "Matz" Matsumoto
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.
2019-07-17Avoid `MRB_INLINE` for `mrb_str_modify()`; ref #4579Yukihiro "Matz" Matsumoto
Functions that are called infrequently need not to be inline.
2019-07-16Merge pull request #4580 from shuujii/unify-type-of-line-number-to-uint16_tYukihiro "Matz" Matsumoto
Unify type of line number to `uint16_t`
2019-07-15Unify type of line number to `uint16_t`KOBAYASHI Shuji
2019-07-15Add `MRB_API` to `mrb_str_modify_keep_ascii()`KOBAYASHI Shuji
2019-07-14Keep `MRB_STR_ASCII` flag in some methods of `String`KOBAYASHI Shuji
2019-07-05Read/write `MRB_STR_ASCII` flag only when `MRB_UTF8_STRING` is definedKOBAYASHI Shuji
2019-07-04Rename `MRB_STR_NO_UTF` to 'MRB_STR_ASCII`; close #4550Yukihiro "Matz" Matsumoto
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.
2019-07-03Refine document to mrb_get_args()` [ci skip]KOBAYASHI Shuji
2019-06-26Merge pull request #4532 from ↵Yukihiro "Matz" Matsumoto
shuujii/fix-String-byteslice-with-MRB_UTF8_STRING-and-some-edge-cases Fix `String#byteslice` with `MRB_UTF8_STRING` and some edge cases
2019-06-25Fix `String#byteslice` with `MRB_UTF8_STRING` and some edge casesKOBAYASHI Shuji
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
2019-06-25Merge pull request #4516 from ↵Yukihiro "Matz" Matsumoto
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`
2019-06-19Remove unneeded statement in `SET_OBJ_VALUE` with `boxing_word.h`KOBAYASHI Shuji
`(r).value.bp` and `v` have the same value due to assignment of the line preceding the removed line.
2019-06-18Fix `struct RRange` overflow on 32-bit CPU with `MRB_NAN_BOXING`KOBAYASHI Shuji
2019-06-13Fix class name validation in `Struct.new`KOBAYASHI Shuji
Before this patch: $ bin/mruby -e 'p Struct.new("A-")' #=> Struct::"A-" After this patch: $ bin/mruby -e 'p Struct.new("A-")' #=> NameError: identifier A- needs to be constant
2019-06-04Need explicit cast for C++dearblue
2019-05-29Add `mrb_alloca` again; ref #4470Yukihiro "Matz" Matsumoto
This time, the allocated memory comes from the string object, which is referenced from GC arena. The memory region will be reclaimed when the C function called from VM is terminated, or the GC arena is restored.
2019-05-25Remove `mrb_alloca()` functiondearblue
When I found this function, I expected it to behave the same as the `alloca(3)` function, but it is accually the `mrb_alloca()` function does not free the heap until the `mrb_close()` function is called. Also, even if it is deleted, it can be replaced with the combination of the `MRB_TT_DATA` object and the `mrb_gv_set()` function if it is sure necessary.
2019-05-25Name the return value of `mrb_range_beg_len()`dearblue
2019-05-22Merge pull request #4403 from dearblue/read-irep-from-bufYukihiro "Matz" Matsumoto
Read irep from buffers
2019-05-21Export `mrb_int_value` that converts `mrb_float` to `Fixnum`.Yukihiro "Matz" Matsumoto
Or `Float` if `mrb_float` value is too big (or too small) to fit in `mrb_int`. The `_int_` in `mrb_int_value` means `Integral` module, which represents integer-like values in mruby.
2019-05-20Add new functions for numerical operation; ref 237a57bYukihiro "Matz" Matsumoto
New functions: * mrb_num_plus(mrb, x, y) * mrb_num_minus(mrb, x, y) * num_num_mul(mrb, x, y)
2019-05-19Remove "LINE" section readerdearblue
Because it is not currently output by `mrbc`.