Skip to content

fix(stdexec): allocate a task's frame with allocator_type() when no allocator is passed - #2353

Open
nebkat wants to merge 1 commit into
NVIDIA:mainfrom
nebkat:fix/task-default-allocator
Open

nebkat wants to merge 1 commit into
NVIDIA:mainfrom
nebkat:fix/task-default-allocator

Conversation

@nebkat

@nebkat nebkat commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

[task.promise] specifies the promise's operator new(size_t) as return operator new(size, allocator_arg, allocator_type());. That holds both before and after P3980R1 (applied to the working draft in cplusplus/draft#8918). task passed std::allocator<std::byte>{} instead, so an environment's allocator_type was only used for the coroutine frame when the coroutine took an allocator_arg parameter.

Environments without an allocator_type are unaffected, since it defaults to std::allocator<std::byte>. An environment whose allocator_type is not default-constructible now requires an allocator_arg parameter, as the wording does; before, such a task compiled and silently used std::allocator.

The new test uses a default-constructible counting allocator to check that the frame is allocated and freed through it.

…llocator is passed

[task.promise] specifies the promise's operator new(size_t) as
operator new(size, allocator_arg, allocator_type()), both before and
after P3980R1. The implementation passed std::allocator<std::byte>
instead, so an environment's allocator_type was only used for the frame
when the coroutine took an allocator_arg parameter.
@copy-pr-bot

copy-pr-bot Bot commented Oct 21, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant