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





On Oct 23, 2026, at 9:37 AM, Taylor R Campbell <riastradh%NetBSD.org@localhost> wrote:

I think a flag is clearer than a magic ctor/dtor.  The point here is
to change the behaviour of pool_cache_get (or pool_cache_put), but the
ctor/dtor explicitly _do not generally_ run on pool_cache_get/put (a
common misunderstanding I have seen, and had myself in the past).
Using them for this role seems likely to be even more confusing.

Counter-argument: Use of a ctor guarantees that the object will be returned to the caller in the constructed state.  The only difference with the “zero” constructor is when it has to be called in order to make that guarantee.

-- thorpej



Home | Main Index | Thread Index | Old Index