Attention is currently required from: pespin.
1 comment:
File include/osmocom/core/osmo_io.h:
Patch Set #1, Line 112: void osmo_iofd_get_ioops(struct osmo_io_fd *iofd, struct osmo_io_ops *ioops);
It may make more sense to return a "const struct osmo_io_ops*" so that no copy is needed by default. […]
If you want to make it generic, it would probably be best to decoupple the segmentation callback from the other callbacks, or even all of the callbacks from each other. That way there wouldn't be any shared struct between the lib and applications.
Using a const pointer doesn't really guarantee that the user won't be able to modify the instance of the struct used/owned by the library. The user can just type-cast it to non-const and then overwrite library data. The copy avoids that.
Regarding struct size: The application and lib already need to agree on this, as the set_io_ops operating also uses that very same struct. So if they need to agree on the "set" side, it is not a problem if the same assumption holds true for the "get"
To view, visit change 36076. To unsubscribe, or for help writing mail filters, visit settings.