Does ruby ​​use the stack to manage memory?

This is rather a hypothetical question, but I have been looking forward to an answer on the Internet for a while.

I read that programming languages ​​use a bunch to store references and a stack for values ​​/ data. In ruby, everything is an object, and we may have to save only links, does ruby ​​use the stack to manage memory, or just a bunch?

Thank you in advance:)

+4
source share
2 answers

It probably depends on the version of Ruby you are talking about. The MRI 1.8.x line used a bunch. See the Engine Yard Blog Post for more details.

+4
source

Maybe a little late, but this article on garbage collection for ruby ​​2.0 should help anyone who wants to better understand it.

http://patshaughnessy.net/2012/3/23/why-you-should-be-excited-about-garbage-collection-in-ruby-2-0

+2
source

Source: https://habr.com/ru/post/1388243/


All Articles