Commit Graph

7140 Commits

Author SHA1 Message Date
Syohei YOSHIDA 787685a0b9 Fix all zero string case 2016-01-14 11:07:07 +09:00
Syohei YOSHIDA 2a661ac612 Add tests which passes all zero string to Kernel#Integer 2016-01-14 11:05:03 +09:00
Yukihiro "Matz" Matsumoto 4924856949 Merge pull request #3082 from jefffederman/feature/install-mruby-with-ruby-install
Update README to mention ruby version management tools
2016-01-14 00:49:25 +09:00
Jeff Federman d2961203b5 Update README to mention ruby version management tools 2016-01-13 10:30:15 -05:00
Yukihiro "Matz" Matsumoto 2f7efda346 Merge pull request #3081 from val00274/fix_toolchains_params
Fix build error in ruby 1.8.
2016-01-13 17:02:38 +09:00
asatou d0668cf9c9 Fix build error in ruby 1.8.
Apply change of #2978 to :clang, :gcc, :visualcpp toolchains
2016-01-13 16:02:58 +09:00
Yukihiro "Matz" Matsumoto 8143285956 Merge pull request #3080 from kou/fix-class-variable-in-module
Fix class variable reference in module
2016-01-11 10:00:34 +09:00
Kouhei Sutou ad492eb9f3 Fix class variable reference in module
Fix #3079
2016-01-11 00:34:15 +09:00
Yukihiro "Matz" Matsumoto fb2e0b721f fixed a problem with upvar access from instance_eval; ref #3072 2016-01-08 09:07:58 +09:00
Yukihiro "Matz" Matsumoto 0000192710 Merge pull request #3077 from sgnr/output-backtrace-segfault
Fix segfault on mrb_exc_backtrace.
2016-01-08 08:40:30 +09:00
Simon Génier 146a9eeb38 Fix segfault on mrb_exc_backtrace.
The code to iterate over backtrace locations was changed in #3065, but
unfortunately output_backtrace was not correctly updated to forward the
callback.
2016-01-07 11:24:16 -05:00
Yukihiro "Matz" Matsumoto f3cce24035 replace mrb_toplevel_run() by mrb_top_run() 2016-01-07 22:48:22 +09:00
Yukihiro "Matz" Matsumoto 258cb2093c mruby-eval: fixed receiver value in eval context; close #3072 2016-01-07 22:37:58 +09:00
Yukihiro "Matz" Matsumoto f7afe1d82a change mrb_run related API names; compatibility macros provided 2016-01-07 22:36:29 +09:00
Yukihiro "Matz" Matsumoto 725b3ca5a7 move KHASH_DECLARE(ht..) to mruby/hash.h; close #3073 2016-01-07 12:46:38 +09:00
Yukihiro "Matz" Matsumoto 7c82bfa7fe mruby-sprintf to use mrb_int formatting macros; ref #3076 2016-01-07 12:23:17 +09:00
Yukihiro "Matz" Matsumoto 3cf5af681a Merge pull request #3074 from syohex/precision-parameter-type
printf precision parameter must be 'int' type
2016-01-07 11:19:43 +09:00
Syohei YOSHIDA 931cc0359a printf precision parameter must be 'int' type
There is a problem when MRB_INT64 is enabled.
2016-01-07 11:06:20 +09:00
Yukihiro "Matz" Matsumoto ec711914a4 Merge pull request #3071 from ksss/symbol
symname_p support `!~`
2016-01-06 13:45:26 +09:00
Yukihiro "Matz" Matsumoto 20ebe9c5eb Merge pull request #3070 from kazuho/kazuho/printf-specifiers
provide macro to ease using printf mrb_int
2016-01-06 12:17:05 +09:00
Kazuho Oku cd131d18a7 define MRB_PRI? that map to PRI?NN depending on the size of mrb_int 2016-01-06 12:00:56 +09:00
ksss af21b365d2 symname_p support !~ 2016-01-06 11:59:09 +09:00
Yukihiro "Matz" Matsumoto 9145aed85e bytes2chars() conversion to fail if target byte offset is not on the character boundary; ref #3067
that means String#index matches first byte of a multi-byte character. this behavior is different
from CRuby, but a compromise for mruby which does not have encoding stuffs.
2016-01-05 18:05:25 +09:00
Yukihiro "Matz" Matsumoto aec825a64c stack_extend before eval_under() 2016-01-04 10:22:38 +09:00
Yukihiro "Matz" Matsumoto aa1f668b80 instance_eval should pass the receiver as a block parameter; close #3029 2016-01-02 22:01:00 +09:00
Yukihiro "Matz" Matsumoto 879e27d0f1 mirb: enlarge code buffer size to 4KB 2016-01-02 16:58:42 +09:00
Yukihiro "Matz" Matsumoto bd462c5edc mruby-fiber: fiber_switch() to use nesting VM when it's called from C API or mrb_funcall(); close #3056 2016-01-02 13:48:45 +09:00
Yukihiro "Matz" Matsumoto 4683b89b84 Merge pull request #3068 from kazuho/kazuho/osx-_setjmp
use _setjmp/_longjmp on OS X
2016-01-01 10:15:55 +09:00
Kazuho Oku 121c6e30aa use _setjmp/_longjmp on other BSD flavors 2016-01-01 06:48:53 +09:00
Kazuho Oku f4bb329c74 use _setjmp/_longjmp on OS X 2016-01-01 06:24:49 +09:00
Yukihiro "Matz" Matsumoto 38b9c2d308 mruby-fiber: add Fiber.yield description; close #3066
Fiber.yield cannot be called from #initialize which is called by
mrb_funcall().  It is mruby limitation.
2015-12-31 21:25:53 +09:00
Yukihiro "Matz" Matsumoto 31b8469bff Merge pull request #3067 from ksss/use-memchr
Use memchr for performance
2015-12-31 21:20:51 +09:00
ksss 6c1b6ef7a5 Use memchr for performance
```ruby
s = "b"
str = ("a" * 100 + s)

t = Time.now
str.index(s)
puts Time.now - t
```

before => 0.000788
after  => 0.000508

---

```ruby
s = "b"
str = ("a" * 100 * 1024 * 1024 + s)

t = Time.now
str.index(s)
puts Time.now - t
```

before => 0.225474
after  => 0.008658
2015-12-31 17:52:22 +09:00
Yukihiro "Matz" Matsumoto 1d7d7062fc __t_printstr__ may not be available for tests 2015-12-31 00:55:07 +09:00
Yukihiro "Matz" Matsumoto 3531fe179c GC must scan env from fibers even when it's not yet copied to heap; fix #3063 2015-12-31 00:11:37 +09:00
Yukihiro "Matz" Matsumoto 4fdec33ff4 simpler t_print 2015-12-30 14:25:05 +09:00
Yukihiro "Matz" Matsumoto ee3fa1be49 Merge pull request #3065 from kou/support-backtrace-after-method-calls
Support backtrace after method calls
2015-12-29 23:49:33 +09:00
Kouhei Sutou 0ebac02813 Skip backtrace related tests when backtrace isn't available 2015-12-29 23:26:31 +09:00
Kouhei Sutou a561bdb25f Support backtrace after method calls
GitHub: fix #2902, #2917

The current implementation traverses stack to retrieve backtrace. But
stack will be changed when some operations are occurred. It means that
backtrace may be broken after some operations.

This change (1) saves the minimum information to retrieve backtrace when
exception is raised and (2) restores backtrace from the minimum
information when backtrace is needed. It reduces overhead for creating
backtrace Ruby objects.

The space for the minimum information is reused by multiple
exceptions. So memory allocation isn't occurred for each exception.
2015-12-29 20:36:12 +09:00
Yukihiro "Matz" Matsumoto e132de9e8e Merge pull request #3064 from kou/fix-indent
Fix indent
2015-12-29 14:25:10 +09:00
Kouhei Sutou 1eeeecb08a Fix indent 2015-12-29 14:20:10 +09:00
Yukihiro "Matz" Matsumoto d3c6fafaf3 Merge pull request #2331 from take-cheeze/struct_test
Improve `Struct` test.
2015-12-26 15:46:49 +09:00
Yukihiro "Matz" Matsumoto 825ced12de remove duplicated local variable declaration 2015-12-26 11:23:28 +09:00
Yukihiro "Matz" Matsumoto d10e304d79 Merge pull request #3062 from suzukaze/refactor-array-each
Refactor Array#each
2015-12-26 10:49:20 +09:00
Yukihiro "Matz" Matsumoto 6218b2e098 Merge pull request #3061 from mattn/fix-ctrl-c
mirb: Don't exit on Ctrl-C
2015-12-26 10:28:50 +09:00
Jun Hiroe 88076901fd Refactor Array#each 2015-12-26 10:12:01 +09:00
kyab 1e34b12a02 mirb: Don't exit on Ctrl-C 2015-12-26 10:03:28 +09:00
Yukihiro "Matz" Matsumoto 76d44b1b48 remove execute bit from mrbgems/mruby-bin-debugger files 2015-12-26 00:07:16 +09:00
Yukihiro "Matz" Matsumoto 6e09abceaf Merge pull request #3058 from mattn/fix-include-blocker
rename include blocker
2015-12-26 00:04:24 +09:00
Yasuhiro Matsumoto f0205e1182 rename include blocker 2015-12-25 13:43:01 +09:00