Kalaky
10/26/2004 1:28:00 AM
Hello,
I'm embedding the ruby interpreter on a large project. I'm allocating
the interpreter
on a special (p)thread with pre-specified stack chunk. This is needed
because the
running scripts are very stack intensive and I don't want users having
to change the
stack limit every time we hit an stack overflow. So the game is: the
user can choose
a large stack-size without needing root privileges, bypassing the
system stack limit.
Unfortunately, Init_stack() uses getrlimit(RLIMIT_STACK) to set STACK_LEVEL_MAX
but getrlimit does not reflect the new stack size, so when the stack
gets higher ruby
kills it self within ruby_stack_check().
I think there should exist another function that is like Init_stack,
but for hard-setting
the stack size and stack_level. Matz, are you interested ?
TIA,
Kalaky