On Sat, 2008-07-26 at 10:07 +0900, Yukihiro Matsumoto wrote:
> Hi,
> MRI stack means the machine stack.  So you can't patch for a bigger
> stack.  limit shell command may work.
> 
> 							matz.
> 

Yes, that works:

$ ruby bm_so_ackermann.rb 
bm_so_ackermann.rb:12:in `ack': stack level too deep (SystemStackError)
	from bm_so_ackermann.rb:12:in `ack'
	from bm_so_ackermann.rb:12:in `ack'
	from bm_so_ackermann.rb:12:in `ack'
	from bm_so_ackermann.rb:12:in `ack'
	from bm_so_ackermann.rb:12:in `ack'
	from bm_so_ackermann.rb:17
$ ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 36864
max locked memory       (kbytes, -l) 32
max memory size         (kbytes, -m) unlimited
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 8192
cpu time               (seconds, -t) unlimited
max user processes              (-u) 36864
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited
$ ulimit -s 32768
$ /usr/bin/time ruby bm_so_ackermann.rb 
24.17user 1.84system 0:26.25elapsed 99%CPU (0avgtext+0avgdata
0maxresident)k
0inputs+0outputs (0major+6893minor)pagefaults 0swaps
$ 

-- 
M. Edward (Ed) Borasky
ruby-perspectives.blogspot.com

"A mathematician is a machine for turning coffee into theorems." --
Alfrd Rnyi via Paul Erds