logo       

Re: Data_Make_Struct Considered Dangerous?: msg#01215

lang.ruby.general

Subject: Re: Data_Make_Struct Considered Dangerous?

Hi,

Based on my experience, I will not use ALLOC unless it is necessary
because of the Ruby gc overhead. Based on what I have learned, when I
write Ruby in C, I will stay away from Ruby gc as far as possible (please
also see my response to Guy). Thanks.

Regards,

Bill
======================================================================
Christian Boos <cboos@xxxxxxxxxxxxxxxxxx> wrote:
> my two cents on that issue:

>> ptr->data2 = Qnil;
>> ptr->data2 = Data_Make_Struct (cInner...);
>> ....

> To me, this doesn't look funny, this looks just THE right thing to do:
> secure already existing data structures reachable from the GC
> before possibly triggering the GC.

> Maybe some more information about this issue in README.ext wouldn't hurt,
> but I don't want a restricted, "safer" C API.
> For instance, ALLOC is an useful wrapper on top of malloc,
> because if needed, it can free memory by triggering a GC.

> -- Christian




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise