Created
February 16, 2009 06:59
-
-
Save jmettraux/65061 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'rubygems' | |
| require 'ffi' | |
| module Hello | |
| extend FFI::Library | |
| attach_function 'puts', [ :string ], :int | |
| end | |
| Hello.puts("hello a") | |
| Hello.send(:puts, "hello b") | |
| # jmettraux:~/tmp/ffi$ ruby stack_level_too_deep.rb | |
| # hello a | |
| # hello b | |
| # jmettraux:~/tmp/ffi$ ruby19 stack_level_too_deep.rb | |
| # hello a | |
| # hello b | |
| # jmettraux:~/tmp/ffi$ jruby-1.1.6 stack_level_too_deep.rb | |
| # hello a | |
| # Error: Your application used more stack memory than the safety cap of 1024k. | |
| # Specify -J-Xss####k to increase it (#### = cap size in KB). | |
| # Specify -w for full StackOverflowError stack trace |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment