From: "Mauricio Fernández" Date: 2005-07-22T07:05:51+09:00 Subject: Re: C extension makes things slower On Fri, Jul 22, 2005 at 05:40:57AM +0900, Phil Tomson wrote: > Oh, for the sake of complete documentation in case someone has similar > questions in the future: [...] Just one minor simplification (also, for the record): > static void aco_point_free(void* p){ > free(p); > } > static VALUE aco_point_alloc(VALUE klass) { > VALUE object; > ACO_Point_Struct* point = (ACO_Point_Struct*)malloc(sizeof( > ACO_Point_Struct)); > object = Data_Wrap_Struct(klass,0,aco_point_free,point); ============== -1 This way, free() will be used (and you hence need no aco_point_free function). -- Mauricio Fernandez