Article View: muc.lists.netbsd.source-changes
Article #11Re: CVS commit: src/sys/dev/usb
From: Jason Thorpe
Date: Fri, 23 Oct 2026 16:48
Date: Fri, 23 Oct 2026 16:48
128 lines
11737 bytes
11737 bytes
--Apple-Mail=_65C01AA3-1B81-42FC-AA60-BBF82B89DDB5 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Oct 23, 2026, at 9:37=E2=80=AFAM, Taylor R Campbell = <riastradh@NetBSD.org> wrote: >=20 > 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 =E2=80=9Czero=E2=80=9D constructor is when it has to be called = in order to make that guarantee. -- thorpej --Apple-Mail=_65C01AA3-1B81-42FC-AA60-BBF82B89DDB5 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 <html aria-label=3D"message body"><head><meta http-equiv=3D"content-type" = content=3D"text/html; charset=3Dutf-8"></head><body = style=3D"overflow-wrap: break-word; -webkit-nbsp-mode: space; = line-break: after-white-space;"><br = id=3D"lineBreakAtBeginningOfMessage"><div><br><blockquote = type=3D"cite"><div>On Oct 23, 2026, at 9:37=E2=80=AFAM, Taylor R = Campbell <riastradh@NetBSD.org> wrote:</div><div><br = style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: = 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; = letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; = text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; = -webkit-text-stroke-width: 0px; text-decoration-line: none; = text-decoration-thickness: auto; text-decoration-style: solid;"><span = style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: = 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; = letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; = text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; = -webkit-text-stroke-width: 0px; text-decoration: none; float: none; = display: inline !important;">I think a flag is clearer than a magic = ctor/dtor. The point here is</span><br style=3D"caret-color: = rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: = normal; font-variant-caps: normal; font-weight: 400; letter-spacing: = normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: = none; white-space: normal; widows: 2; word-spacing: 0px; = -webkit-text-stroke-width: 0px; text-decoration-line: none; = text-decoration-thickness: auto; text-decoration-style: solid;"><span = style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: = 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; = letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; = text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; = -webkit-text-stroke-width: 0px; text-decoration: none; float: none; = display: inline !important;">to change the behaviour of pool_cache_get = (or pool_cache_put), but the</span><br style=3D"caret-color: rgb(0, 0, = 0); font-family: Helvetica; font-size: 12px; font-style: normal; = font-variant-caps: normal; font-weight: 400; letter-spacing: normal; = orphans: 2; text-align: start; text-indent: 0px; text-transform: none; = white-space: normal; widows: 2; word-spacing: 0px; = -webkit-text-stroke-width: 0px; text-decoration-line: none; = text-decoration-thickness: auto; text-decoration-style: solid;"><span = style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: = 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; = letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; = text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; = -webkit-text-stroke-width: 0px; text-decoration: none; float: none; = display: inline !important;">ctor/dtor explicitly _do not generally_ run = on pool_cache_get/put (a</span><br style=3D"caret-color: rgb(0, 0, 0); = font-family: Helvetica; font-size: 12px; font-style: normal; = font-variant-caps: normal; font-weight: 400; letter-spacing: normal; = orphans: 2; text-align: start; text-indent: 0px; text-transform: none; = white-space: normal; widows: 2; word-spacing: 0px; = -webkit-text-stroke-width: 0px; text-decoration-line: none; = text-decoration-thickness: auto; text-decoration-style: solid;"><span = style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: = 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; = letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; = text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; = -webkit-text-stroke-width: 0px; text-decoration: none; float: none; = display: inline !important;">common misunderstanding I have seen, and = had myself in the past).</span><br style=3D"caret-color: rgb(0, 0, 0); = font-family: Helvetica; font-size: 12px; font-style: normal; = font-variant-caps: normal; font-weight: 400; letter-spacing: normal; = orphans: 2; text-align: start; text-indent: 0px; text-transform: none; = white-space: normal; widows: 2; word-spacing: 0px; = -webkit-text-stroke-width: 0px; text-decoration-line: none; = text-decoration-thickness: auto; text-decoration-style: solid;"><span = style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: = 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; = letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; = text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; = -webkit-text-stroke-width: 0px; text-decoration: none; float: none; = display: inline !important;">Using them for this role seems likely to be = even more = confusing.</span></div></blockquote></div><div><br></div><div>Counter-argu= ment: Use of a ctor guarantees that the object will be returned to the = caller in the constructed state. The only difference with the = =E2=80=9Czero=E2=80=9D constructor is when it has to be called in order = to make that guarantee.</div><br><div> <span class=3D"Apple-style-span" style=3D"border-collapse: separate; = color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; = font-style: normal; font-variant: normal; font-weight: normal; = letter-spacing: normal; line-height: normal; orphans: 2; text-align: = auto; text-indent: 0px; text-transform: none; white-space: normal; = widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; = -webkit-border-vertical-spacing: 0px; = -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: = auto; -webkit-text-stroke-width: 0px; "><div style=3D"word-wrap: = break-word; -webkit-nbsp-mode: space; -webkit-line-break: = after-white-space; ">-- thorpej</div></span> </div> <br></body></html>= --Apple-Mail=_65C01AA3-1B81-42FC-AA60-BBF82B89DDB5-- -- Posted automagically by a mail2news gateway at muc.de e.V. Please direct questions, flames, donations, etc. to news-admin@muc.de
Technical Details
Message-ID:
<06836EF3-F904-47ED-9429-84E731D3BF24@me.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!2.eu.feeder.erje.net!feeder.erje.net!news2.arglkargh.de!news.karotte.org!news.space.net!news.muc.de!.POSTED.news.muc.de!not-for-mailReferences:
<20261023163739.BA36A84D84@mail.netbsd.org>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!2.eu.feeder.erje.net!feeder.erje.net!news2.arglkargh.de!news.karotte.org!news.space.net!news.muc.de!.POSTED.news.muc.de!not-for-mail From: Jason Thorpe <thorpej@me.com> Newsgroups: muc.lists.netbsd.source-changes Subject: Re: CVS commit: src/sys/dev/usb Date: Fri, 23 Oct 2026 09:48:40 -0700 Organization: Newsgate at muc.de e.V. Sender: source-changes-d-owner@NetBSD.org Approved: news-admin@muc.de Distribution: world Message-ID: <06836EF3-F904-47ED-9429-84E731D3BF24@me.com> References: <20261023163739.BA36A84D84@mail.netbsd.org> MIME-Version: 1.0 (Mac OS X Mail 16.0 \(3864.500.181\)) Content-Type: multipart/alternative; boundary="Apple-Mail=_65C01AA3-1B81-42FC-AA60-BBF82B89DDB5" Injection-Info: news.muc.de; posting-host="news.muc.de:193.149.48.2"; logging-data="60834"; mail-complaints-to="news-admin@muc.de" Authentication-Results: mail.netbsd.org (amavisd-new); dkim=pass (2048-bit key) header.d=me.com X-ICL-RepId: 01a169aa-56bc-76a5-b391-449eca5c35b1 X-ICL-Out-Info: HUtFAUMEWwJACUgATUQeDx5WFlZNRAJCTQhPHVwGRQNGC1YBWQJLVxQEDFsCRRtXGnkVVkNUBF9QXxwOAFJFUR9UWEEOCl4SGFwUXFBYHkYSVg1dCRkaQV5QG18CQg8cE1YVEx1DGQ8rCEoEQwdFAl4LJRMJU1ZfFRcbXAAXBlsUBEQDWw9YBDV/Sx4rDlsGXQ1PdikaUgZCAFULWXJcAUF9S3ErBV9yHVxWUAJaVRIEQAhWUF4IXh9MHA== Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=1a1hai; t=1792774134; x=1824310134; bh=LsWRhr1kFz9xS3JzJaAk3JzY3YEEMjNebgfFm3DdVcY=; h=From:Message-Id:Content-Type:Mime-Version:Subject:Date:To:x-icloud-hme; b=Ow4mKqJzYvWfl2bZm3T1JF/Rzh/aYWuayHEj+MJRYsNSQKVH8ZevvheaBdOGHFAQIYnI81KGZcgcuyeXRskvqcRNI4S9vpMbQm0I6bYy4fMOU579fsDRSZqWI81vexd25U3gaCc57zbHc/cHJeHZb62S9GhZ98OzyuFaB6zI2Mb07YV6pjwvq2LiiklEJKurjihEMu6T6oCI+fgxZIrRkxE2EiNgvx4tJxWWW+KY8WfNHrBbdIBqFMJcX9kp9E7rGsghiEbwmw96dSeir7iMEa5XGr5iIPQ83w5Bj8rZRNkmknugiMf4bd2obs0SNnCB/wT0YdXPmqD9Li6bHe6iqQ== In-Reply-To: <20261023163739.BA36A84D84@mail.netbsd.org> X-Proofpoint-ORIG-GUID: el9N8BQiHlO6-ZL1hv908WYeGOq_QjiY X-Proofpoint-GUID: el9N8BQiHlO6-ZL1hv908WYeGOq_QjiY X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMDIzMDA2NSBTYWx0ZWRfX3v5UCNCs3c0r 4ZyGJ2HEMZMjOZ4l1rsXGeVD5D/Ih8+4ScKMx8cC2okBY2d0fAtQBVAELxO1iFJa6l/v4d2Qs8y /m4NTigFFFNY0nsSIozs++s0iVojS1k4Z67DNqrRv8FYq0JUBRK9l4YvhIn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