Is an embedded ruby interpreter safe to unload

L

Lothar Scholz

Hello ruby-talk,

when i use ruby embedded in a program where i call "ruby_init", do a
few ruby magics and then call "ruby_finalize".

Will this free all used memory?
 
G

gga

Hello ruby-talk,

when i use ruby embedded in a program where i call "ruby_init", do a
few ruby magics and then call "ruby_finalize".

Will this free all used memory?

You want to call ruby_cleanup(0); instead, like ruby_stop() does.
ruby_finalize() does not deal with threads.
 
L

Lothar Scholz

Hello gga,

g> You want to call ruby_cleanup(0); instead, like ruby_stop() does.
g> ruby_finalize() does not deal with threads.

Thanks,

i looked at the source and realize that there is no way to cleanly
shutdown the ruby interpreter. This will just call all registered exit
functions.

Very very bad because this means it's very hard to use memory leak checking
tools for extensions or much worse for systems that use ruby as an embedded
interpreter.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top