Skip to content

Add async::pmr_context #88

Open

Description

@kammce

This is a simple context that accepts a memory resource as an input and uses it to allocate the memory for the stack. It also calls cancel() deallocates the memory on destruction.

Activity

  1. kammce commented on Apr 21, 2026

    @kammce
    MemberAuthor

    I just realized today that this object has a bit of a problem. async::context isn't movable and if this inherits it, then its also not going to be movable. But having a version of a context that is movable seems very useful. We can consider this like a smart pointer where you need to use the operator*() and operator->() to access the context. That way, it just holds a pointer to the object and a pointer to the memory resource it used to allocate the memory.

    So this type will not inherit async::context but instead will have an API async::context& operator*();.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions