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:48 AM, Jason Thorpe <thorpej%me.com@localhost> wrote:

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.

Ok, “guarantees” is maybe too strong of a statement.  Part of the pool_cache API contract is that, when using a constructor, you’ll also put things back into the cache in a valid constructed state (this is the same behavior as Solaris’s kmem_cache).

But I don’t think that invalidates my argument here.  It’s still part of the API contract that pool_cache_get() returns a constructed object.

-- thorpej



Home | Main Index | Thread Index | Old Index