Gerardo Santana Góíez Garrido wrote: > I have a class A written in C that contains a C structure. I have > defined the functions mark, alloc and free. > > I have another class B, written in C, that derives from class A and > adds another piece of C data. > > Should the class B define mark, alloc and free functions for both, > class A and class B, C structures? > > Or sould the class B care for its own C structure only? Will Ruby's > marking, allocation and liberation mechanism call their respective > functions? > > I got confused. Thanks in advance. Class B needs to take care of both the A and B members, somehow, in its mark, free, and alloc. Ruby doesn't know anything about how the structs are related. Btw, my cgen project[1] is a framework that supports defining classes with C structs that inherit all the housekeeping stuff, not just mark/free/alloc, but also persistence and accessors: [1] http://redshift.sourceforge.net/cgen http://redshift.sourceforge.net/cgen/lib/cgen/cshadow.html -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407