summaryrefslogtreecommitdiffhomepage
path: root/include
AgeCommit message (Collapse)Author
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`.
2019-05-18Rename `struct RIstruct` to `struct RIStruct`.Yukihiro "Matz" Matsumoto
2019-05-17(Proof of Concept) mruby tuning profiles [ci skip]dearblue
Not only mruby, it is one of the difficult things to adjust the performance vs. memory efficiency of the software. If the approximate target device is divided and the adjustment value for it is prepared by default, it is a good indicator to do fine adjustment. This PR divides into four profiles. ***Caution: There is no basis for the definitions in the patch.*** - `MRB_CONSTRAINED_BASELINE_PROFILE` - for microprocessors. Reduce memory consumption. - `MRB_BASELINE_PROFILE` - Default value of mruby. - `MRB_MAIN_PROFILE` - For desktop computers. Assume that a huge amount of RAM, 10 MiB or more, is on board. - `MRB_HIGH_PROFILE` - for servers. Assume that mruby VM has a long life. As you can see the profile name has been ~~stolen~~ imitated from H.264.
2019-05-17Make unused functions private.Yukihiro "Matz" Matsumoto
* mrb_fixnum_plus() * mrb_fixnum_minus() * mrb_fixnum_mul()
2019-05-17Remove unused `mrb_num_div()` function.Yukihiro "Matz" Matsumoto
2019-05-17Use `mrb_float` instead of `double` in `FIXABLE_FLOAT`.Yukihiro "Matz" Matsumoto
2019-05-16Set maximum string (and symbol) size to 65534 (`UINT16_MAX-1`).Yukihiro "Matz" Matsumoto
The previous value (`UINT16_MAX`) was too long for symbols, so it raises an exception after the length check.
2019-05-15Initial suffix supportUkrainskiy Sergey
2019-05-15Merge pull request #4400 from ↵Yukihiro "Matz" Matsumoto
shuujii/fix-name-assignment-to-frozen-anonymous-class-module Fix name assignment to frozen anonymous class/module
2019-05-02Fixed include specifier format for `mruby/common.h`.Yukihiro "Matz" Matsumoto
2019-04-27Update document for `MRB_USE_CUSTOM_RO_DATA_P`dearblue
2019-04-27Update document for any configurationsdearblue
- (Modify) `MRB_INT16` - (Add) `MRB_INT32` - (Modify) `MRB_INT64` - (Add) `MRB_USE_ETEXT_EDATA` - (Add) `MRB_NO_INIT_ARRAY_START - (Add) `MRB_WITHOUT_FLOAT` - (Add) `MRB_METHOD_CACHE` - (Add) `MRB_METHOD_CACHE_SIZE` - (Add) `MRB_METHOD_TABLE_INLINE - (Add) `MRB_ENABLE_ALL_SYMBOLS`
2019-04-26Add customized `mrb_ro_data_p()`dearblue
User definable `mrb_ro_data_p()` functions are available by defining `MRB_USE_CUSTOM_RO_DATA_P`. (Limitation) It can not be defined as an inline function.
2019-04-24Add mruby binary loader functions from buffer memorydearblue
Add new functions (with `MRB_API`): - `mrb_read_irep_buf()` - `mrb_load_irep_buf()` - `mrb_load_irep_buf_cxt()`
2019-04-24Reorganize defines related to `MRB_INLINE`; ref #4391Yukihiro "Matz" Matsumoto
2019-04-24Remove unnecessary `mrb_regexp_check()` and related functions.Yukihiro "Matz" Matsumoto
2019-04-23Fix name assignment to frozen anonymous class/moduleKOBAYASHI Shuji
Fix the following issues: A = Class.new.freeze #=> FrozenError Module.new::B = Class.new.freeze #=> FrozenError String::B = Module.new.freeze #=> FrozenError
2019-04-22Merge pull request #4391 from dearblue/inlinesYukihiro "Matz" Matsumoto
Change modifier to `MRB_INLINE` from `static inline`
2019-04-20Expand `BOXWORD_SET_VALUE()` macro in `include/mruby/boxing_word.h`KOBAYASHI Shuji
In `SET_OBJ_VALUE()`, branch isn't removed because `switch` condition isn't constant expression.
2019-04-19Add `mrb_true_p()` and `mrb_false_p()` macro functionsdearblue
2019-04-19Change modifier to `MRB_INLINE` from `static inline`dearblue
2019-04-16Avoid potential zero size array declaration; fix #4382KOBAYASHI Shuji
2019-04-10Remove `MRB_API` from `mrb_instance_new`.Yukihiro "Matz" Matsumoto