Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Find a way to stack allocate sockets #789

Open
yorickpeterse opened this issue Dec 16, 2024 · 1 comment
Open

Find a way to stack allocate sockets #789

yorickpeterse opened this issue Dec 16, 2024 · 1 comment
Labels
feature New things to add to Inko, such as a new standard library module runtime Changes related to the Rust-based runtime library std Changes related to the standard library

Comments

@yorickpeterse
Copy link
Collaborator

Description

#783 introduces the ability to define inline types capable of storing inline, copy and heap types.

Sockets are still heap allocated however. This is because internally the runtime mutates the registered flag atomically, and such changes need to be visible across borrows.

We need to find a way such that we can either get rid of the mutations of this field, while still being able to (de/re)register the socket whenever necessary.

Related work

@yorickpeterse yorickpeterse added feature New things to add to Inko, such as a new standard library module runtime Changes related to the Rust-based runtime library std Changes related to the standard library labels Dec 16, 2024
@yorickpeterse
Copy link
Collaborator Author

This also requires changes to the deadline API: we rely on setting a deadline field on the socket, which won't work if we define it as inline. I'm not a fan of this API to begin with, so perhaps there's a better alternative worth looking into.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New things to add to Inko, such as a new standard library module runtime Changes related to the Rust-based runtime library std Changes related to the standard library
Projects
None yet
Development

No branches or pull requests

1 participant