|
Re: Data_Make_Struct Considered Dangerous?: msg#01208lang.ruby.general
>>>>> "W" == William Djaja Tjokroaminata <billtj@xxxxxxxxxxxxxx> writes: W> Right now, the solution is simply to add this line: W> .... ptr-> data2 = Qnil; ptr-> data2 = Data_Make_Struct (cInner...); W> .... No, this is not the solution. If you make a right use of Data_Make_Struct ptr->data2 == NULL before the call to Data_Make_Struct() and you can test this in the mark functions. W> 1) NEVER use Data_Make_Struct. Use Data_Wrap_Struct instead. W> 2) NEVER use Ruby's ALLOC. Use, at least, C's malloc instead. Don't say this : this is *stupid* First learn how to use the ruby API, and remove *your* bugs in the source of your extension before trying to say such stupidities. Guy Decoux
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | ANN: JRuby beta 1.6/0.5.1, Anders Bengtsson |
|---|---|
| Next by Date: | RE: Data_Make_Struct Considered Dangerous?, Christian Boos |
| Previous by Thread: | Data_Make_Struct Considered Dangerous?, William Djaja Tjokroaminata |
| Next by Thread: | Re: Data_Make_Struct Considered Dangerous?, William Djaja Tjokroaminata |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |