I am not C programmer, and actually even don't know if this is any
problem at all. I just read a blog post that sounded a bit scary, and
wanted to ask people from Ruby side, is this actually a real problem
or just some rant/misunderstanding.
> I am not C programmer, and actually even don't know if this is any > problem at all. I just read a blog post that sounded a bit scary, and > wanted to ask people from Ruby side, is this actually a real problem > or just some rant/misunderstanding.
> Be warned, it was written in a *not* very nice manner...
> Thank you for your attention.
Thank you for posting this.
The need for RB_GC_GUARD(v) is probably due to faulty register spilling in the MRI eval/thread/GC machinery; the PRE_GETCONTEXT() and POST_GETCONTEXT() macros in MRI eval.c might be the real problem.
In contrast, the Boehm-Demers-Weiser (BDW) GC library manages to flush registers without demanding client code to explicitly flush pointers to the stack.
However, in general, it is problematic, in language design practice to make GC contracts completely transparent to API client code. This difficultly is explicitly solved in the design of Lua:
Lua mediates all object references through stack manipulations. They were able to implement a generational write-barrier with little (or no) GC API contracts.
MRI does not (yet) need a read or write barrier; it s unclear why RB_GC_GUARD() is needed at all except to cover up a bug elsewhere.
On Jul 6, 3:26 am, Ernest <est%iest...@gtempaccount.com> wrote:
> Hello,
> I am not C programmer, and actually even don't know if this is any
> problem at all. I just read a blog post that sounded a bit scary, and
> wanted to ask people from Ruby side, is this actually a real problem
> or just some rant/misunderstanding.
> On Jul 6, 3:26 am, Ernest <est%iest...@gtempaccount.com> wrote: >> Hello,
>> I am not C programmer, and actually even don't know if this is any >> problem at all. I just read a blog post that sounded a bit scary, and >> wanted to ask people from Ruby side, is this actually a real problem >> or just some rant/misunderstanding.