Source-Changes-D archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: CVS commit: src/sys/dev/usb
> Date: Fri, 23 Oct 2026 05:53:38 -0700
> From: Jason Thorpe <thorpej%me.com@localhost>
>
> > On Oct 22, 2026, at 7:23 PM, Taylor R Campbell <riastradh%netbsd.org@localhost> wrote:
> >
> > I think this change may not be correct. I don't think pool_cache_get
> > respects PR_ZERO. Perhaps we should add an assertion about this and
> > audit the system for it (or make it work by judiciously adding a
> > memset if PR_ZERO is passed).
>
> pool_cache_get() is intended to return constructed objects. I guess
> making it support PR_ZERO is OK so long as the cache doesn't specify
> a constructor function, and should blow up on incompatible arguments
> if it does have one.
Maybe PR_ZERO should be an option to pool_cache_init rather than to
pool_cache_get? (And pool_cache_get should assert that it is _not_
set. Also pool_cache_init can assert that ctor/dtor is mutually
exclusive with PR_ZERO.)
Kind of unfortunate that the PR_* namespace is reused for five
different purposes (pool_init, pool_get, pool_cache_init,
pool_cache_get, and struct pool internal pr_flags), but at least the
numbers don't collide so we could do it.
Home |
Main Index |
Thread Index |
Old Index