Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Dec 2019 14:47:34 -0800
From:      John Baldwin <jhb@FreeBSD.org>
To:        Hans Petter Selasky <hps@selasky.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r355600 - in head: share/man/man9 sys/kern sys/sys
Message-ID:  <a784738e-2667-49e7-10ca-bcbf54f47cf8@FreeBSD.org>
In-Reply-To: <3cc78418-6692-058c-eba5-1edc5286aeab@selasky.org>
References:  <201912102158.xBALwUF9075354@repo.freebsd.org> <3cc78418-6692-058c-eba5-1edc5286aeab@selasky.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 12/10/19 2:09 PM, Hans Petter Selasky wrote:
> On 2019-12-10 22:58, John Baldwin wrote:
>>   While here, add <sys/callout.h> to the manpage.
> 
> FYI:
> 
> Linux guys eliminated the "void *c_arg" in their timer implementation by 
> using container_of() to get callback argument. We could possibly do the 
> same!

You mean passing the pointer to the callout itself and using that to get to the
relevant pointer?  That seems less obvious from a code readability standpoint.
We also don't actually guarantee that the 'struct callout' is still alive when
the function is called currently (hence the need for the local variables that
store a copy of the fields).

-- 
John Baldwin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?a784738e-2667-49e7-10ca-bcbf54f47cf8>