summaryrefslogtreecommitdiffhomepage
path: root/src/object.c
AgeCommit message (Collapse)Author
2019-10-20Use `mrb_str_cat_str` instead of `mrb_str_concat` if possibleKOBAYASHI Shuji
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-26Use type predicate macros instead of `mrb_type` if possibleKOBAYASHI Shuji
For efficiency with `MRB_WORD_BOXING` (implement type predicate macros for all `enum mrb_vtype`).
2019-08-05Use new specifiers/modifiers of `mrb_vfromat()`KOBAYASHI Shuji
The binary sizes (gems are only `mruby-bin-mruby`) are reduced slightly in my environment than before the introduction of new specifiers/modifiers (5116789a) with this change. ------------+-------------------+-------------------+-------- BINARY | BEFORE (5116789a) | AFTER (This PR) | RATIO ------------+-------------------+-------------------+-------- mruby | 593416 bytes | 593208 bytes | -0.04% libmruby.a | 769048 bytes | 767264 bytes | -0.23% ------------+-------------------+-------------------+-------- BTW, I accidentally changed `tasks/toolchains/visualcpp.rake` at #4613, so I put it back.
2019-05-11Use `mrb_ensure_string_type` in `mrb_to_str`KOBAYASHI Shuji
2019-03-02Do not apply `mrb_ptr()` to immediate objects; fix #4307Yukihiro "Matz" Matsumoto
2018-11-19Restore `mrb_string_type` function for compatibility.Yukihiro "Matz" Matsumoto
2018-11-19Removed `to_hash` conversion method.Yukihiro "Matz" Matsumoto
2018-11-19Removed `to_ary` conversion method.Yukihiro "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-02-13Check if `to_int` returns `fixnum` value; fix #3946Yukihiro "Matz" Matsumoto
2017-10-11Add MRB_WITHOUT_FLOATYAMAMOTO Masaya
2017-09-27fix: mrbgems\mruby-kernel-ext\src\kernel.c(114): warning C4244: 'function': ↵Tomasz Dąbrowski
conversion from 'mrb_int' to 'int', possible loss of data
2017-08-18Separate `mrb_str_buf_new` and `mrb_str_new_capa`.Yukihiro "Matz" Matsumoto
`mrb_str_buf_new` is an old function that ensures capacity size of `MRB_STR_BUF_MIN_SIZE` minimum. Usually one need to use `mrb_str_new_capa` instead.
2017-05-26Add new range check macro FIXABLE_FLOAT(); ref #3652Yukihiro "Matz" Matsumoto
When MRB_INT64, valid value range of mrb_int is bigger than double, which only has 53 bits significant precision.
2017-04-11Fixed a bug in `mrb_convert_to_integer()`; fix #3581Yukihiro "Matz" Matsumoto
Did not update the result from `mrb_check_string_type()` before string-to-integer conversion.
2016-12-01Use mrb_ptr instead of mrb_cptr in Kernel#to_sBouke van der Bijl
This is to avoid segfault when WORD_BOXING is enabled Reported by https://hackerone.com/brakhane
2016-11-30Prohibit instantiation of immediate objectsYukihiro "Matz" Matsumoto
2016-11-24Avoid casting from int to unsigned char for C++; ref #3267Yukihiro "Matz" Matsumoto
2016-11-17renamed "inline" to "istruct" to represent inline struct; ref #3251Yukihiro "Matz" Matsumoto
2016-11-17inline structures data type for mruby (MRB_TT_INLINE) (fix #3237)Tomasz Dąbrowski
Inline structures have no instance variables, no finalizer, and offer as much space as possible in RBASIC object. This means 24 bytes on 64-bit platforms and 12 bytes on 32-bit platforms. mruby-inline-struct gem is only provided for testing.
2015-12-16Add case statement of MRB_TT_SCLASS in mrb_obj_is_kind_of()Kei Sawada
2015-11-27include changed from by quotes ("") to by brackets (<>); close #3032Yukihiro "Matz" Matsumoto
2015-10-20Increasing docs coverageSeba Gamboa
2015-09-05remove `origin` member to implement prepend from struct RClass; ref #2885Yukihiro "Matz" Matsumoto
instead origin is saved in ICLASS with MRB_FLAG_IS_ORIGIN set.
2015-07-13Set origin when doing kind_of? comparisonsBlaž Hrastnik
2015-06-24Remove unnecessary backticks.Franck Verrot
Dr Markus Kuhn published in 1999 an article [1] explaining in details why we shouldn't use the ASCII grave accent (0x60) as a left quotation. Backticks have been used most notably to produce nice-looking LaTeX documents but it doesn't seem to be an issue on modern platforms and for the oldest ones, there are workarounds as mentioned by Dr Kuhn. [1]: https://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
2014-10-29Fix mrb_convert_to_integer.Jun Hiroe
2014-08-18revert mrb_equal methodkkkkkt
2014-08-18refactor mruby method(fix indent. remove temporary value, duplicate procedure)kkkkkt
2014-08-04rename obsolete mrb_special_const_p to mrb_immediate_pYukihiro "Matz" Matsumoto
2014-08-04add MRB_API modifiers to mruby API functionsYukihiro "Matz" Matsumoto
2014-07-09Clean up value.h and mrb_value boxingDavid Turnbull
2014-03-16fix bool number to macroksss
2014-03-12fix mrb_funcall callingtake_cheeze
2014-03-08use mrb_str_cat_lit for literalscremno
2014-03-06make embed string when create literalsksss
2014-03-06embed small stringksss
use flags 4 for *this object is embed* use flags 8~64 for *embed string length*
2014-03-01use C style comments instead of C++ style commentscubicdaiya
According to CONTRIBUTING.md, Don't use C++ style comments /* This is the prefered comment style */ Use C++ style comments only for temporary comment e.g. commenting out some code lines.
2014-02-27use mrb_str_cat_lit() intead of mrb_str_catcubicdaiya
2014-02-13mrb_str_cat2: deprecated since 0cedf8fcremno
2014-02-09Merge pull request #1674 from cremno/mrb_bool-FALSE-TRUEYukihiro "Matz" Matsumoto
use mrb_bool, FALSE and TRUE more
2014-02-06use mrb_str_new_lit() more widelyYukihiro "Matz" Matsumoto
2014-01-31use mrb_bool, FALSE and TRUE morecremno
It doesn't matter to me if one is using FALSE/TRUE instead of 1/0 but I prefer a type (alias) which emphasizes boolean vars to int. I changed 1/0 to FALSE/TRUE anyway.
2014-01-07remove superfluous includescremno
- reduce compile time by a little bit (full-core: ~0.7s for me) - thanks to 'include-what-you-use' for some help - include Standard C header files before any other (coding style)
2014-01-02tiny word boxing optimizationcremno
2013-12-19fix TypeError messageh2so5
2013-10-26mrb_Integer() should not convert strings to integersYukihiro "Matz" Matsumoto
2013-09-21rename voidp to cptrYukihiro "Matz" Matsumoto