| ▲ | pansa2 11 minutes ago | |
> The C interface to ruby is just superb. How does it handle garbage collection? AFAIK GC is the main reason behind Lua's stack-based API: it's designed so that C code never needs to hold a pointer to a Lua object, which means an object will never be garbage-collected while C code is still trying to use it. OTOH Python does allow C code to hold such pointers - so it requires that code to perform error-prone manual reference-counting. How does Ruby solve this problem? | ||