Commit Graph

752 Commits

Author SHA1 Message Date
Yukihiro "Matz" Matsumoto 0c91da257b Remove unused mrb_num_div() function. 2019-05-17 11:27:21 +09:00
Yukihiro "Matz" Matsumoto 283530b19b Use mrb_float instead of double in FIXABLE_FLOAT. 2019-05-17 10:37:49 +09:00
Yukihiro "Matz" Matsumoto 304b52fabe Set maximum string (and symbol) size to 65534 (UINT16_MAX-1).
The previous value (`UINT16_MAX`) was too long for symbols, so it raises
an exception after the length check.
2019-05-16 11:44:51 +09:00
Yukihiro "Matz" Matsumoto 7f1f499b22 Merge pull request #4400 from shuujii/fix-name-assignment-to-frozen-anonymous-class-module
Fix name assignment to frozen anonymous class/module
2019-05-15 15:47:02 +09:00
dearblue 302ad847a3 Add customized mrb_ro_data_p()
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-26 21:28:57 +09:00
Yukihiro "Matz" Matsumoto 163a6d01e0 Reorganize defines related to MRB_INLINE; ref #4391 2019-04-24 12:09:16 +09:00
Yukihiro "Matz" Matsumoto 0c5f26e0ff Remove unnecessary mrb_regexp_check() and related functions. 2019-04-24 11:43:05 +09:00
KOBAYASHI Shuji cc7f9190ba Fix name assignment to frozen anonymous class/module
Fix the following issues:

  A = Class.new.freeze              #=> FrozenError
  Module.new::B = Class.new.freeze  #=> FrozenError
  String::B = Module.new.freeze     #=> FrozenError
2019-04-23 20:45:38 +09:00
Yukihiro "Matz" Matsumoto 49cb149033 Merge pull request #4391 from dearblue/inlines
Change modifier to `MRB_INLINE` from `static inline`
2019-04-22 21:17:27 +09:00
KOBAYASHI Shuji b212050026 Expand BOXWORD_SET_VALUE() macro in include/mruby/boxing_word.h
In `SET_OBJ_VALUE()`, branch isn't removed because `switch` condition isn't
constant expression.
2019-04-20 21:23:58 +09:00
dearblue 125c3bef19 Add mrb_true_p() and mrb_false_p() macro functions 2019-04-19 22:50:05 +09:00
dearblue 6907e97fa1 Change modifier to MRB_INLINE from static inline 2019-04-19 22:24:22 +09:00
KOBAYASHI Shuji 79a7f18150 Avoid potential zero size array declaration; fix #4382 2019-04-16 19:56:11 +09:00
Yukihiro "Matz" Matsumoto 88ac7549c0 Remove MRB_API from mrb_instance_new. 2019-04-10 19:11:35 +09:00
Yukihiro "Matz" Matsumoto f882b6908e Merge pull request #4357 from mruby/stable
Update version and release date. `mruby 2.0.1 (2019-4-4)`
2019-04-05 17:06:21 +09:00
KOBAYASHI Shuji ed41bbb199 Use mrb_proc_arity instead of Proc#arity call in Method#arity 2019-04-04 22:17:26 +09:00
Hiroshi Mimaki 7c91efc1ff Update version and release date.
`mruby 2.0.1 (2019-4-4)`
2019-04-04 09:26:40 +09:00
KOBAYASHI Shuji 9b7e9addcd Pad leading zero to month and day in MRUBY_RELEASE_DATE
For Ruby compatibility.
2019-04-02 16:24:07 +09:00
Yukihiro "Matz" Matsumoto 2871d0cdc5 Avoid keeping pointers from mrb_sym2name_len(); fix #4342
The addresses for packed inline symbols reference `mrb->symbuf` that
could be overridden by the later call of `mrb_sym2name_len`. Since
file names in call stack information are kept as symbols, keeping the
address in the C structures could cause problems like #4342.

This changes small incompatible changes in function prototypes:
* `mrb_parser_get_filename`: return value changed to `mrb_sym`.
* `mrb_debug_get_filename`: add `mrb_state*` as a first argument.
* `mrb_debug_get_line`: ditto.

I believe above functions are almost internal, and no third-party
mrbgem use them.
2019-04-01 14:13:06 +09:00
Yukihiro "Matz" Matsumoto c2660b8111 Fix missing MRB_API prefix for functions below; clse #4267
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-03-26 10:23:52 +09:00
KOBAYASHI Shuji 16b1b2978e Fix constant name validation
`X!` etc are invalid constant name.
2019-03-14 23:09:05 +09:00
dearblue d1db959cab Fix to defined MRB_SYMBOL_BITSIZE and MRB_SYMBOL_MAX always; ref #4077 2019-02-16 21:24:05 +09:00
KOBAYASHI Shuji 69fd1a5925 Fix Symbol#size for multi-byte characters with MRB_UTF8_STRING
Before:

  p :あ.size  #=> 3

After:

  p :あ.size  #=> 1
2019-02-04 18:11:22 +09:00
dearblue d6d02774c5 Fix memory leak sval when out of memory in Data_Wrap_Struct() 2019-01-20 14:23:22 +09:00
Yukihiro "Matz" Matsumoto 81862fd689 Update compiled binary format version; ref #4219 2019-01-08 21:44:40 +09:00
Yukihiro "Matz" Matsumoto d38a8e8807 Update OP_APOST description (typo fixed). 2019-01-08 21:43:04 +09:00
KOBAYASHI Shuji eb216fc858 range: Refactor range.h/range.c
Functions order, name, linkage and so on.
2019-01-03 20:09:41 +09:00
KOBAYASHI Shuji 648b57620a range: Embed edges in RRange on boxing environment.
[Breaking changes]

Developers must use following APIs for accessing attributes of RRange
because RRange structure depends on boxing setting.

- mrb_range_beg
- mrb_range_end
- mrb_range_excl_p
2019-01-01 15:35:56 +09:00
dearblue 49cce74c1a Suppress __STDC_VERSION__ warns for C++ 2018-12-23 17:22:59 +09:00
dearblue e19353be25 Fix macro expressions with paren 2018-12-18 23:14:26 +09:00
dearblue 14133f4057 Fix macro arguments with paren 2018-12-18 23:05:36 +09:00
Yukihiro "Matz" Matsumoto e65d42644a Remove #include <mruby/khash.h> from mruby/hash.h. 2018-12-17 15:59:42 +09:00
dearblue 62dd4d89fc Add mrb_hash_size() function. 2018-12-14 21:41:07 +09:00
Yukihiro "Matz" Matsumoto 730b925332 Merge pull request #4184 from mruby/stable
Release mruby 2.0.0
2018-12-11 11:52:33 +09:00
Hiroshi Mimaki 1c09046c13 Update release date. 2018-12-11 10:52:20 +09:00
Yukihiro "Matz" Matsumoto 265171a28c Rename ht_foreach_func to mrb_hash_foreach_func. 2018-12-11 10:41:26 +09:00
Yukihiro "Matz" Matsumoto e935d20ab5 Add mrb_ prefix to iv_foreach_func. 2018-12-11 10:39:53 +09:00
Yukihiro "Matz" Matsumoto a0df27d8e0 Add new API mrb_iv_foreach() to iterate over instance variables. 2018-12-11 09:48:15 +09:00
Yukihiro "Matz" Matsumoto c0d91a14e7 Add API function mrb_hash_foreach() to iterate over items in a hash. 2018-12-11 09:01:05 +09:00
Yukihiro "Matz" Matsumoto 91bf55bbe5 Remove do { ... } while(0) hacks from MRB_TRY macros.
Because it can swallow `break` etc. if they are used in loops.
2018-11-25 06:05:07 +09:00
Rob Fors c9a66d4c41 Update documentation to mrb_load_irep 2018-11-20 21:27:03 -05:00
Yukihiro "Matz" Matsumoto 68c5384830 Update version number; fix #4165 2018-11-20 10:43:34 +09:00
Yukihiro "Matz" Matsumoto ec19c34a20 Fixed a bug in mirb heredoc handling; fix #3989 2018-11-20 10:39:34 +09:00
Yukihiro "Matz" Matsumoto 53e2df3e93 Restore mrb_string_type function for compatibility. 2018-11-19 16:13:26 +09:00
Yukihiro "Matz" Matsumoto 9516731329 Use type checking mrb_to_str instead of converting mrb_str_to_str. 2018-11-19 12:08:28 +09:00
Yukihiro "Matz" Matsumoto 698f5f707c Removed to_ary conversion method. 2018-11-19 12:08:28 +09:00
Yukihiro "Matz" Matsumoto ff08856fe3 Remove implicit conversion using to_str method; fix #3854
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-19 12:05:46 +09:00
Yukihiro "Matz" Matsumoto 25d390d6cc Improve Hash table using variable sized segments. 2018-11-19 09:30:15 +09:00
Yukihiro "Matz" Matsumoto 7e3e8d8ed5 Shrink file name table size to uint16_t; ref #4138 2018-11-15 23:34:32 +09:00
Yukihiro "Matz" Matsumoto 61f49690e4 Remove filename&lines from mrb_irep struct.
This patch slightly reduce memory consumption (2% for my test).
2018-11-15 21:01:56 +09:00