summaryrefslogtreecommitdiffhomepage
path: root/include/mruby.h
AgeCommit message (Collapse)Author
2020-06-20Add `mrb_get_arg1()` that retrieves single (and only) argument.Yukihiro "Matz" Matsumoto
`mrb_get_arg1()` raises `ArgumentError` if the method does not receive one argument. And replaces all `mrb_get_args(mrb, "o", &arg)` by the new function.
2020-06-05Merge master.Hiroshi Mimaki
2020-05-31Fix float constant redefinition warningsRory OConnell
2020-05-07Remove `mrb_run` from `MRB_API`; #4488Yukihiro "Matz" Matsumoto
`mrb_run` requires to push callinfo stack before calling, which is very hard from outside of `vm.c`. So there should be virtually no correct usage of the function, hence the cause of #4488. We removed it. You can use `mrb_top_run(mrb, proc, self, 0)` instead of `mrb_run(mrb, proc self)`.
2020-04-26Reduce `struct mrb_context`dearblue
2020-04-22Add new function `mrb_singleton_class_ptr()`; ref #4973Yukihiro "Matz" Matsumoto
The difference between `mrb_singleton_class` and `mrb_singleton_class_ptr`: - `mrb_singleton_class_ptr` returns `struct RClass*`. - `mrb_singleton_class_ptr` returns `NULL` on immediate values where `mrb_singleton_class` raises exceptions.
2020-04-10Update version to `2.1.1`. (mruby 2.1.1 RC)2.1.1-rcHiroshi Mimaki
2020-01-30Move fallback definitions of `FLT_EPSILON` etc. after `#include <mruby/value.h>`Yukihiro "Matz" Matsumoto
that includes `float.h`. It allows definitions from native headers.
2020-01-01Rename `mrb_num_args_error` to `mrb_argnum_error`; ref #4863Yukihiro "Matz" Matsumoto
2019-12-12Add `mrb_num_args_error()` for "wrong number of arguments" errorKOBAYASHI Shuji
To unify the style of messages.
2019-10-06Get keyword arguments with `mrb_get_args()`dearblue
Keyword arguments can now be retrieved with the `:` specifier and `mrb_kwargs` data. For the interface, I referred to CRuby's `rb_get_kwargs()`. For implementation, I referred to `OP_KARG` or etc.
2019-10-04Freeze strings from `nil.to_s`, `true.to_s`, `false.to_s`.Yukihiro "Matz" Matsumoto
This is an experimental changes in Ruby 2.7.
2019-09-26Fixed `codedump` for human readable symbol format; ref #4684Yukihiro "Matz" Matsumoto
2019-09-25Rename symbol-to-string functions; close #4684Yukihiro "Matz" Matsumoto
* mrb_sym2name -> mrb_sym_name * mrb_sym2name_len -> mrb_sym_name_len * mrb_sym2str -> mrb_sym_str
2019-09-16Remove `MRB_METHOD_TABLE_INLINE`.Yukihiro "Matz" Matsumoto
`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.
2019-09-16Refactor `mrb_method_t`.Yukihiro "Matz" Matsumoto
2019-09-14Add argument names to C function prototypes.Yukihiro "Matz" Matsumoto
2019-09-14Add a macro `mrb_frozen_p` that points to `MRB_FROZEN_P`.Yukihiro "Matz" Matsumoto
2019-09-14Remove `mrb_funcall` from `<=>` operations.Yukihiro "Matz" Matsumoto
2019-08-26fix lots of warnings and make logo not so bigDavid Siaw
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-07Update `mrb_to_str` and related functions.Yukihiro "Matz" Matsumoto
Contrary to the name, `mrb_to_str` just checks type, no conversion.
2019-07-03Refine document to mrb_get_args()` [ci skip]KOBAYASHI Shuji
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-02Fixed include specifier format for `mruby/common.h`.Yukihiro "Matz" Matsumoto
2019-04-24Remove unnecessary `mrb_regexp_check()` and related functions.Yukihiro "Matz" Matsumoto
2019-04-19Change modifier to `MRB_INLINE` from `static inline`dearblue
2019-04-10Remove `MRB_API` from `mrb_instance_new`.Yukihiro "Matz" Matsumoto
2019-04-10Merge pull request #4367 from shuujii/extract-frozen-checking-to-functionYukihiro "Matz" Matsumoto
Extract frozen checking to function
2019-04-09Extract frozen checking to functionKOBAYASHI Shuji
2019-04-08Remove unneeded function prototypesKOBAYASHI Shuji
2019-04-04Update version and release date.2.0.1Hiroshi Mimaki
`mruby 2.0.1 (2019-4-4)`
2019-03-29va_list is defined in stdarg.h.Tomoyuki Sahara
fixes build on OpenBSD.
2019-03-26Fix missing `MRB_API` prefix for functions below; clse #4267Yukihiro "Matz" Matsumoto
Functions to add prototypes to headers: * mrb_ary_splice() * mrb_notimplement() * mrb_vformat() * mrb_cstr_to_dbl() * mrb_cstr_to_inum() Functions to be made `static` (`MRB_API` was not needed): * mrb_mod_module_function() * mrb_obj_hash() * mrb_str_len_to_inum() Functions to remove `MRB_API` from definitions (referenced from within `libmruby`): * mrb_mod_cv_defined() * mrb_mod_cv_get() * mrb_f_send()
2019-02-17Fix typosyui-knk
2019-02-12Implement inline packed symbols.Yukihiro "Matz" Matsumoto
Small symbols with all alphanumeric characters (<5) are packed in 32bit symbol integer a la base64. This means those small symbols are not listed in `Symbol.all_symbols`.
2019-02-06Implement symbol hash table to boost `find_symbol`.Yukihiro "Matz" Matsumoto
In 4174e02, we removed the symbol hash table from `mrb_state` but `find_symbol` was too slow with linear search. My performance estimation was wrong. So we implemented a new compact hash table for symbols.
2019-02-06Remove symbol hash table from `mrb_state` structure.Yukihiro "Matz" Matsumoto
Use linear search instead. Number of symbols is usually small (<1K), so we don't need performance boost from hash tables. In our benchmark measurement, hash tables consumes 790KB for `build/full-debug/mrbtest`.
2018-12-23Suppress __STDC_VERSION__ warns for C++dearblue
2018-12-18Fix macro arguments with parendearblue
2018-11-20Restrict total recursion number of `ecall()`; fix #3789Yukihiro "Matz" Matsumoto
2018-11-19Remove implicit conversion using `to_str` method; fix #3854Yukihiro "Matz" Matsumoto
We have added internal convenience method `__to_str` which does string type check. The issue #3854 was fixed but fundamental flaw of lack of stack depth check along with fibers still remains. Use `MRB_GC_FIXED_ARENA` for workaround.
2018-11-19Remove implicit conversion using `to_int` method.Yukihiro "Matz" Matsumoto
The ISO standard does not include implicit type conversion using `to_int`. This implicit conversion often causes vulnerability. There will be no more attacks like #4120. In addition, we have added internal convenience method `__to_int` which does type check and conversion (from floats).
2018-09-25Fix minor typos (#4126)Daniel Varga
2018-08-29Fix type of `eidx` and `ridx` from `uint8_t` to `uint16_t`; fix #4088Yukihiro "Matz" Matsumoto
A byte was too small to hold ensure&rescue stacks indexes.
2018-08-29Move back `mrb_define_alias` to `mruby.h` to avoid breakage.Yukihiro "Matz" Matsumoto
2018-08-25Reduce integer casting warnings.Yukihiro "Matz" Matsumoto