From 086788ab80e0e630ba20aeb94d5f7a6ae9247d50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20K=C3=B6ppe?= Date: Sun, 22 Nov 2026 20:20:05 -0300 Subject: [PATCH 1/2] P4453R1 Memory allocation with senders/receivers; a response to IE-133 Fixes IE 133 (C++26 DIS) Editorial notes: In [task.state]... * Moved "Let ev be" up to the beginning of Effects: to avoid a typographic ambiguity in the list item where it appeared originally. * Used code blocks for long expressions. * Inserted a comma after "otherwise" in the last item. --- source/exec.tex | 64 +++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 59 insertions(+), 5 deletions(-) diff --git a/source/exec.tex b/source/exec.tex index 3455a61a0a..a97fe93579 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -446,6 +446,7 @@ // \ref{exec.queries}, queries struct @\libglobal{forwarding_query_t}@ { @\unspec@ }; struct @\libglobal{get_allocator_t}@ { @\unspec@ }; + struct @\libglobal{get_scheduler_allocator_t}@ { @\unspec@ }; struct @\libglobal{get_stop_token_t}@ { @\unspec@ }; inline constexpr forwarding_query_t @\libglobal{forwarding_query}@{}; @@ -892,6 +893,30 @@ \tcode{forwarding_query(get_allocator)} is a core constant expression and has value \tcode{true}. +\rSec2[exec.get.scheduler.allocator]{\tcode{get_scheduler_allocator}} + +\pnum +\tcode{get_scheduler_allocator} asks a queryable object for an associated allocator to be used by a scheduler. + +\pnum +The name \tcode{get_scheduler_allocator} denotes a query object. +For a subexpression \tcode{env}, +\tcode{get_scheduler_allocator(env)} is expression-equivalent to +\tcode{\exposid{MANDATE-NOTHROW}(\exposid{AS-CONST}(env).query(get_scheduler_allocator))} +if that expression is well-formed, +otherwise it is expression-equivalent to +\tcode{\exposid{MANDATE-NOTHROW}(\allowbreak +\exposid{AS-CONST}(env).query(get_allocator))}. + +\mandates +If the expression \tcode{get_scheduler_allocator(env)} is well-formed, +its type satisfies +\exposconceptx{simple-al\-locator}{simple-allocator}\iref{allocator.requirements.general}. + +\pnum +\tcode{forwarding_query(get_scheduler_allocator)} is a core constant expression and +has value \tcode{true}. + \rSec2[exec.get.stop.token]{\tcode{get_stop_token}} \pnum @@ -7986,18 +8011,47 @@ \begin{itemdescr} \pnum \effects +Let \tcode{\placeholder{ev}} be the object \tcode{get_env(\exposid{rcvr})}. Let \tcode{\placeholder{prom}} be the object \tcode{\exposid{handle}.promise()}. -Associates \tcode{\exposid{STATE}(\placeholder{prom})}, \tcode{\exposid{RCVR}(\placeholder{prom})}, and \tcode{\exposid{SCHED}(\placeholder{prom})} +Associates \tcode{\exposid{STATE}(\placeholder{prom})}, +\tcode{\exposid{RCVR}(\placeholder{prom})}, +and \tcode{\exposid{SCHED}(\placeholder{prom})} with \tcode{*this} as follows: \begin{itemize} \item \tcode{\exposid{STATE}(\placeholder{prom})} is \tcode{*this}. \item \tcode{\exposid{RCVR}(\placeholder{prom})} is \exposid{rcvr}. -\item \tcode{\exposid{SCHED}(\placeholder{prom})} is the object initialized -with \tcode{start_scheduler_type(get_start_scheduler(get_env(\exposid{rcvr})))} -if that expression is valid and \tcode{start_scheduler_type()} otherwise. -If neither of these expressions is valid, the program is ill-formed. +\item \tcode{\exposid{SCHED}(\placeholder{prom})} is an object initialized with +\begin{itemize} +\item if +\begin{codeblock} +same_as> +\end{codeblock} +is \tcode{true}, \tcode{get_start_scheduler(\placeholder{ev})}; +\item otherwise, +\begin{codeblock} +start_scheduler_type(get_start_scheduler(@\placeholder{ev}@), get_scheduler_allocator(@\placeholder{ev}@)) +\end{codeblock} +if this expression is valid; +\item otherwise, \tcode{start_scheduler_type(get_start_scheduler(\placeholder{ev}))} +if this expression is valid; +\item otherwise, \tcode{start_scheduler_type(get_scheduler_allocator(\placeholder{ev}))} +if this expression is valid; +\item otherwise, \tcode{start_scheduler_type()} if this expression is valid; +\item otherwise, the program is ill-formed. \end{itemize} +\end{itemize} + +\pnum Finally, invokes \tcode{\exposid{handle}.resume()}. + +\pnum +\remarks +If \tcode{get_start_scheduler(get_env(\exposid{rcvr}))} +is a valid expression, then the result shall remain valid for +the duration of the asynchronous operation's lifetime. +If \tcode{get_scheduler_allocator(get_env(\exposid{rcvr}))} +is a valid expression, then the result shall remain valid for +the duration of the asynchronous operation's lifetime. \end{itemdescr} \indexlibrarymember{\exposid{get-stop-token}}{task::\exposid{state}}% From c3ffb03fd9cc182f43b160f6eab624a632dcee68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20K=C3=B6ppe?= Date: Sun, 22 Nov 2026 20:19:53 -0300 Subject: [PATCH 2/2] [execution.syn] Add missing definition of the "get_scheduler_allocator" object. This synopsis change was accidentally omitted from P4453R1 (but obviously this object is meant to exist, and referred to in the rest of the wording). --- source/exec.tex | 1 + 1 file changed, 1 insertion(+) diff --git a/source/exec.tex b/source/exec.tex index a97fe93579..1911788f2b 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -451,6 +451,7 @@ inline constexpr forwarding_query_t @\libglobal{forwarding_query}@{}; inline constexpr get_allocator_t @\libglobal{get_allocator}@{}; + inline constexpr get_scheduler_allocator_t @\libglobal{get_scheduler_allocator}@{}; inline constexpr get_stop_token_t @\libglobal{get_stop_token}@{}; template