Jeff King <peff@xxxxxxxx> writes: > Alternatively, I think some of our other OO code just leaves room for > a type-specific void pointer, like: > > struct bulk_checkin_source { > ...the usual stuff... > > void *magic_type_data; > }; > > and then the init_bulk_checkin_source_from_fd() function allocates its > own heap struct for the magic_type_data field and sticks the int in > there. Yup. All the pros-and-cons makes sense. I earlier said I found this a good place to stop, exactly because the full OO with struct specific_subclass { struct vtbl *vtbl; struct base_class common_data_specific_to_instance; ... other instance specific data members here ...; } would require us to add too many supporting infrastructure struct types; with only a few subclasses in use, it is a bit too much to justify.