|
RE: Data_Make_Struct Considered Dangerous?: msg#01209lang.ruby.general
Hi, my two cents on that issue: > -----Original Message----- > From: William Djaja Tjokroaminata [mailto:billtj@xxxxxxxxxxxxxx] > Sent: Tuesday, August 13, 2002 3:50 PM > To: ruby-talk ML > Subject: Data_Make_Struct Considered Dangerous? > > ... > > Right now, the solution is simply to add this line: > > .... > ptr->data2 = Qnil; > ptr->data2 = Data_Make_Struct (cInner...); > .... > > I don't know whether this is really all there is to it. At least, for > people who don't understand, the code may look funny, because it seems > the Qnil assignment is just a waste. 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> |
|---|---|---|
| Previous by Date: | Re: Data_Make_Struct Considered Dangerous?, ts |
|---|---|
| Next by Date: | Re: [OT] Programming practice question, Michael Campbell |
| Previous by Thread: | Re: Data_Make_Struct Considered Dangerous?, Michael Campbell |
| Next by Thread: | Re: Data_Make_Struct Considered Dangerous?, William Djaja Tjokroaminata |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |