From: Junio C Hamano Date: Tue, 13 Mar 2012 21:17:03 GMT Subject: Re: [PATCH] Use macro HANDLER_WRAPPER in sigchain to wrap clean function of sigchain Message-ID: <7vlin4td4g.fsf@alter.siamese.dyndns.org> In-Reply-To: <20120313205501.GB27436@sigill.intra.peff.net> Jeff King writes: > So I don't like boilerplate or repetition, but this may be one of those > times where it is simply more clear to just be verbose. Yes, I agree with you 100% re: these particular repetitions. >> *1* Yes, I know, this casts between a data pointer and a function pointer >> that is not portable, but the purpose of this pseudo-code is primarily to >> illustrate the high level view of the idea. We would probably want to be >> able to pass callback value to the clean_foo() function and at that point, >> we would likely to be passing a pointer to a struct, and we could declare >> the first element of such a struct is a pointer to a sigchain_fn, or >> something. > > That is the correct way to do it, but where does the struct memory come > from? Probably somewhere near "struct sigchain_signal" are kept.