summaryrefslogtreecommitdiffhomepage
path: root/src/etc.c
AgeCommit message (Collapse)Author
2020-06-15Remove unused `MRB_TT_FILE`.Yukihiro "Matz" Matsumoto
2020-04-13Fix `MRB_TT_CPTR` object with `MRB_NAN_BOXING`dearblue
Previously, if `MRB_NAN_BOXING` is defined, for example, `mrb_cptr_value()` could not keep an odd address. If it is `MRB_32BIT`, it can be embedded in `NaN` as it is. If it is `MRB_64BIT`, some operations are shared with `MRB_WORD_BOXING`. In this case, the MRB_API function `mrb_nan_boxing_cptr_value()` is defined.
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-07-02Fix and refine error message in `mrb_obj_to_sym()`KOBAYASHI Shuji
Before this patch: $ bin/mruby -e '1.respond_to?(2)' #=> nil is not a symbol After this patch (same as Ruby): $ bin/mruby -e '1.respond_to?(2)' #=> 2 is not a symbol nor a string
2019-07-01Remove unused C header file from `src/etc.c`KOBAYASHI Shuji
2019-04-24Remove unnecessary `mrb_regexp_check()` and related functions.Yukihiro "Matz" Matsumoto
2019-04-11Remove incorrect flags updating in `mrb_regexp_p()`KOBAYASHI Shuji
2019-04-10Use `mrb_immediate_p()` in `mrb_obj_freeze()` and `mrb_obj_frozen()`KOBAYASHI Shuji
2018-08-30Separate meta-programming features to `mruby-metaprog` gem.Yukihiro "Matz" Matsumoto
We assume meta-programming is less used in embedded environments. We have moved following methods: * Kernel module global_variables, local_variables, singleton_class, instance_variables, instance_variables_defined?, instance_variable_get, instance_variable_set, methods, private_methods, public_methods, protected_methods, singleton_methods, define_singleton_methods * Module class class_variables, class_variables_defined?, class_variable_get, class_variable_set, remove_class_variable, included_modules, instance_methods, remove_method, method_removed, constants * Module class methods constants, nesting Note: Following meta-programming methods are kept in the core: * Module class alias_method, undef_method, ancestors, const_defined?, const_get, const_set, remove_const, method_defined?, define_method * Toplevel object define_method `mruby-metaprog` gem is linked by default (specified in default.gembox). When it is removed, it will save 40KB (stripped:8KB) on x86-64 environment last time I measured.
2017-10-11Add MRB_WITHOUT_FLOATYAMAMOTO Masaya
2017-10-01Use `uint32_t` to avoid signed integer overflow warning; #3816Yukihiro "Matz" Matsumoto
2017-08-10Normalize float numbers before calculating a hash value.Yukihiro "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.
2016-02-04cache mrb_regexp_p(); ref #980Yukihiro "Matz" Matsumoto
2015-11-27include changed from by quotes ("") to by brackets (<>); close #3032Yukihiro "Matz" Matsumoto
2015-08-11Remove non-need tmp valuego.kikuta
2015-06-02remove unnecessary mrb_immediate_p()cremno
`!mrb_array_p(ary2)` and `mrb_type(obj) != MRB_TT_DATA` are sufficient.
2014-08-21changed to call check_cv_name_str in check_cv_name_sym and adjust indentkkkkkt
2014-08-06Fix a typo in etc.cbggd
2014-08-04Merge branch 'master' of github.com:mruby/mrubyYukihiro "Matz" Matsumoto
2014-08-03MSVC: add simple (v)snprintf implementationcremno
_snprintf is not C99's snprintf! This simple implementation, unlike _snprintf, always null-terminates and returns the expected return value (in most cases). Other C99 behaviors (like format specifiers) require adding a complete snprintf implementation. Do we want or need that? The same applies to vsnprintf (aka _vsnprintf).
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-09rename word boxing functionsYukihiro "Matz" Matsumoto
2014-07-09Clean up value.h and mrb_value boxingDavid Turnbull
2014-05-15move mrb_irep_remove_lv from etc.c to mruby-bin-strip gemYukihiro "Matz" Matsumoto
2014-05-15Support `LVAR` section removing.take_cheeze
2014-04-29cast intptr_t to mrb_int to pacify compiler warning; close #2148Yukihiro "Matz" Matsumoto
2014-04-17Add mrb_regexp_p to check whether mrb_value is Regexp.take_cheeze
2014-03-15calc hash value directly for strings, symbols and numbersYukihiro "Matz" Matsumoto
2014-01-30etc.c: small cleanup (delete unused functions)cremno
mrb_data_object_alloc: unnecessary cast mrb_lastline_get: mruby doesn't support $_, weird and unused code mrb_exec_recursive: see 4e46abb86914b36e70b5f3ad0826d0b648e9b4ef mrb_block_proc: unused, doesn't really do anything (or needs to be rewritten) mrb_obj_to_sym: actually use id (and MSVC detected unreachable code)
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)
2013-11-27float objects in pool are objects when MRB_WORD_BOXING is setYukihiro "Matz" Matsumoto
2013-09-21rename voidp to cptrYukihiro "Matz" Matsumoto
2013-08-15redesign mruby/data.h API; use DATA_PTR() for raw data pointer, ↵Yukihiro "Matz" Matsumoto
DATA_GET_PTR() to type safe retrieval (TypeError will be raised), DATA_CHECK_GET_PTR() to get nil if type mismatched
2013-08-07rename mrb_value_p() to mrb_ptr() since _p means predicate in mruby sourceYukihiro "Matz" Matsumoto
2013-08-03add read barrier to value.pYuichi Nishiwaki
API changes: - value.p must be accessed via mrb_value_p macro - value.p must be mutated via MRB_SET_VALUE_P macro
2013-05-26Add MRB_WORD_BOXING mode (represent mrb_value as a word)kimu_shu
2013-04-29rename mrb_to_id to mrb_obj_to_sym since symbol is nothing to do with ↵Yukihiro "Matz" Matsumoto
identifier in mruby
2013-04-04rename DATA API: mrb_get_datatype -> mrb_data_get_ptr; mrb_check_datatype -> ↵Yukihiro "Matz" Matsumoto
mrb_data_check_and_get
2013-03-27use new mrb_format API from mrb_raisef; its only format specifier is "%S" ↵Yukihiro Matz Matsumoto
(stringify) and takes mrb_value; close #1062
2013-03-01Merge branch 'pluggable_struct' of https://github.com/mattn/mruby into ↵Yukihiro Matz Matsumoto
mattn-pluggable_struct
2013-03-01Add typedef to structures that have mrb_ prefix. Use typedef-ed type instead ↵Masaki Muranaka
of struct directly.
2013-03-01Pluggable Structmattn
2013-02-24Remove commented out code. Remove redundant function calls.Masaki Muranaka
2013-02-18remove TT_REGEX and TT_MATCHYukihiro Matz Matsumoto
2013-02-15Pluggable Regexpmattn
2012-11-04remove FL_XXX macrosYukihiro Matz Matsumoto