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

Memory stream create/delete #595

Open
guregu opened this issue Sep 18, 2024 · 3 comments
Open

Memory stream create/delete #595

guregu opened this issue Sep 18, 2024 · 3 comments

Comments

@guregu
Copy link
Contributor

guregu commented Sep 18, 2024

Expand memory stream support (currently used by with_output_stream etc.) a bit to allow creating more than one and name them. This is mainly useful for the wasm stuff to capture output in a nested manner (e.g. run a program that uses with_output_stream without clobbering it, building HTTP responses and the like).
I have implemented this in my fork so it'd be a relatively easy feature to port over here.
The biggest change is adding a "is this stream valid?" macro and using it instead of checking against stream.fp in many places.
Here's what I currently have, but maybe a different naming scheme would be better as it works a little differently than the is_* macros that take a cell: https://github.com/guregu/trealla/blob/78eef6f5ee2124b7dcd1f9e8e8567c8843e73f20/src/builtins.h#L61-L69

It this sounds like a good idea I'll make a PR.

@guregu guregu mentioned this issue Sep 18, 2024
10 tasks
@infradig
Copy link
Contributor

infradig commented Sep 18, 2024 via email

@infradig
Copy link
Contributor

Go ahead and do a PR and i'll look at that.

@guregu
Copy link
Contributor Author

guregu commented Sep 24, 2024

I’ll prepare a PR sometime this week

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

No branches or pull requests

2 participants