|
From: Jeremy F. <je...@go...> - 2005-03-30 23:18:57
|
Nicholas Nethercote wrote:
> Giving the tool direct access to the VG_(tool_interface) struct
> doesn't seem like a good idea -- it exposes it to more than it needs
> to see.
Agreed.
> So this would simply separate structs corresponding to each of the
> multi-arg functions in the patch now. Only two of those functions are
> really bad -- VG_(needs_tool_errors)() has 8 args, VG_(malloc_funcs)()
> has 10. Do you think we need structs for the ones with only 1, 2 or 3
> args?
It would seem silly to have lots of little structures, but having two
calling styles isn't terribly pretty either (and one presumes that at
some point you'd need to convert a called-with-pointers function to a
called-with-a-struct function when the number of functions reaches a
certain point). I guess structures for the biggies and literal pointers
for the 1,2,3 cases, but I still think a simple one registry function
per function model is cleaner and more robust in the long term.
J
|