On Thu, 2008-08-21 at 08:56 -0700, Garrett D'Amore - sun microsystems
wrote:
> For blocks allocated using xesballoc() frtn_t.free_func will be passed
> a second argument, a pointer to a boolean_t, effectively giving it a
> type of:
> 
> void (*free_func)(caddr_t, boolean_t *)

> If the driver does not modify the boolean then it remains B_FALSE. In
> this case the STREAMS block will be freed when free_func() returns, as
> is the case with blocks allocated using desballoc(9F). 

is there some reason why you didn't define a xfrtn_t (since the function
signature of the free callback is different), and why you didn't use a
function signature of:

boolean_t (*free_func)(caddr_t) 

(returning B_TRUE or B_FALSE as appropriate)

the former seems appropriate from a cleanliness perspective (give the
compiler a better chance to catch type mismatches); the latter seems
simpler and my vague recollection was that it was slightly more
efficient as well.  

                                                - Bill





Reply via email to