Skip to content

Maybe use a thread-local Context #7

@Radvendii

Description

@Radvendii

We only really need one Context per thread. We could look into using thread-local variables, but they add complication and might not work cross-platform.

If rust guarantees that they will work on all platforms it supports, then they are an option.

Regardless, this isn't essential because Store and EvalState are expensive enough objects that allocating another Context for each is not going to be noticeable.

Mostly it would just be a little cleaner, so we don't need to have context fields floating around and making sure when we create new structs that we add them in where they're needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions