C++ Logo

std-proposals

Advanced search

Re: [std-proposals] User-Defined Trivial Constructors

From: Thiago Macieira <thiago_at_[hidden]>
Date: Mon, 12 Jan 2026 15:11:34 -0600
On Monday, 12 January 2026 09:50:08 Central Standard Time Jason McKesson via
Std-Proposals wrote:
> > The first process to create that memory area (the one that ftruncate'd the
> > file to extend its size from zero) must do std::construct_at to start the
> > lifetime of each and every object. All other processes that attach to it
> > will share this lifetime that has started.
>
> How can another process actually *know* that this can happen? Are we
> to presume that every time you create shared memory, that this also
> creates some kind of interprocess communication interface outside of
> that?

That's an ABI limitation. If there were such a thing as a lifetime tracking
portion of memory, then all applications using shared memory would need to use
it.

There isn't, so they don't.

> > No. I am saying that the tools (UBsan) need to be adjusted to reality, not
> > that we should bend ourselves over backwards and change current, working
> > practice.
>
> Or we could just clearly declare what's actually going on rather than
> presuming systems can figure it out.

I would prefer to keep them as annotations for UBSan, like we do for TSan
annotations.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Principal Engineer - Intel Data Center - Platform & Sys. Eng.

Received on 2026-01-12 21:11:40