diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2016-02-12 00:46:28 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2016-02-12 00:46:28 +0900 |
| commit | f40fc9ab6965f1fdbbec63e05da839eaa10970b9 (patch) | |
| tree | 9f7999b6bffdc0d19646bc25e50a7166999a7ab7 | |
| parent | 18870428bc4489d25ec89c973fe1d8e67250c29c (diff) | |
| parent | e7eb40f9d663b3b618f5fb3618c217daafb2a337 (diff) | |
| download | mruby-f40fc9ab6965f1fdbbec63e05da839eaa10970b9.tar.gz mruby-f40fc9ab6965f1fdbbec63e05da839eaa10970b9.zip | |
Merge pull request #3099 from deuwert/more-limits
Addition to mruby limitation documentation
| -rw-r--r-- | doc/limitations.md | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/doc/limitations.md b/doc/limitations.md index dd153f9ce..f60ab5930 100644 --- a/doc/limitations.md +++ b/doc/limitations.md @@ -64,3 +64,80 @@ end #### mruby [1.2.0 (2015-11-17)] No exception is raised. + +## Check of infinite recursion + +mruby does not check infinite recursion across C extensions. + +```ruby +def test; eval 'test'; end; test +``` + +#### Ruby [ruby 2.0.0p645 (2015-04-13 revision 50299)] + +```SystemStackError``` is raised. + +#### mruby [1.2.0 (2015-11-17)] + +Segmentation fault. + +## Fiber execution can't cross C function boundary + +mruby's ```Fiber``` is implemented in a similar way to Lua's co-routine. This +results in the consequence that you can't switch context within C functions. +Only exception is ```mrb_fiber_yield``` at return. + +## ```Array``` does not support instance variables + +To reduce memory consumption ```Array``` does not support instance variables. + +```ruby +class Liste < Array + def initialize(str = nil) + @feld = str + end +end + +p Liste.new "foobar" +``` + +#### Ruby [ruby 2.0.0p645 (2015-04-13 revision 50299)] + +``` [] ``` + +#### mruby [1.2.0 (2015-11-17)] + +```ArgumentError``` is raised. + +## Method visibility + +For simplicity reasons no method visibility (public/private/protected) is +supported. + +```ruby +class VisibleTest + + def public_method; end + + private + def private_method; end + +end + +p VisibleTest.new.respond_to?(:private_method, false) +p VisibleTest.new.respond_to?(:private_method, true) +``` + +#### Ruby [ruby 2.0.0p645 (2015-04-13 revision 50299)] + +``` +false +true +``` + +#### mruby [1.2.0 (2015-11-17)] + +``` +true +true +``` |
