From: Claudio Fiorini Date: 2009-01-24T10:53:16+09:00 Subject: [ruby-core:21545] Re: Data_Wrap_Struct question about mark and free function > You only need to specify a mark function if your wrapped data has > references to other ruby objects, otherwise null is fine. > > You only need to specify a free function if you want Ruby's garbage > collector to free memory for your data when the object is collected > (which you probably do). > > I typically avoid Data_Wrap_Struct these days and use something not > unlike Data_Set_Struct. This lets me separate allocate/initialize into > separate functions (so I would wrap a null pointer in the allocate > function and set the DATA_PTR in the initialize function). > > Paul Thanks, i used Data_Wrap_Struct just with a free function. claudio