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

Improve the memory model #1

Open
booniepepper opened this issue Jul 12, 2023 · 2 comments
Open

Improve the memory model #1

booniepepper opened this issue Jul 12, 2023 · 2 comments
Milestone

Comments

@booniepepper
Copy link
Collaborator

booniepepper commented Jul 12, 2023

The memory model is incredibly naive right now: Arena allocate everything, and only free when the entire program completes. This is passable (and fast!) for simple cases, but would scale terribly for long-running processes since no memory is almost never freed.

Maya gave some good critiques in this Zig discord thread:

https://discord.com/channels/605571803288698900/1128605557796905020

@edt-xx
Copy link

edt-xx commented Oct 28, 2023

Yah. This is a really good idea. duck tape is nice in both its physical and software variants. Was going to open a bug on memory usage when I saw this.... If you want your process killed, try this increasing 20 to 100000 or so:

seq 20 | ./dt 'deq swap drop [ deq swap \d: [ d divisor? not ] filter d pl ] [ swap dup rot len ] while'

ps. Its a little pita to use 'swap dup rot ' instead of over ( a b --- a b a )...

@booniepepper
Copy link
Collaborator Author

For memory management, I'm working through exactly what I want to do in this project: https://github.com/booniepepper/dt-rewrite

Getting close to a point where I'll start incorporating it

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 a pull request may close this issue.

2 participants