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

Safe heap allocation via ST #7

Open
paf31 opened this issue May 23, 2015 · 2 comments
Open

Safe heap allocation via ST #7

paf31 opened this issue May 23, 2015 · 2 comments

Comments

@paf31
Copy link
Contributor

paf31 commented May 23, 2015

This is not my area of expertise, but it seems like ST would be a nice way to use the type system to avoid reference counting. Would this be possible?

The idea is that we would malloc and delete the appropriate things in runST, and stack allocate everything else.

I'm not sure how this would affect things like sharing in data structures.

@andyarvanitis
Copy link
Owner

I think using something like this as a memory management option is a great idea. I've also wondered about the use of effects for it too. The plan is definitely to have a default memory management mechanism in place, but to allow such alternatives (as well as something like the Boehm libgc or other GCs).

FYI, reference counting is currently only used for data and records, everything else is handled by value (i.e. on the stack).

@andyarvanitis
Copy link
Owner

This should be pretty easy to do now: https://github.com/andyarvanitis/pure11/wiki/Memory#unmanaged-data

joprice pushed a commit to joprice/purescript-native that referenced this issue Oct 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants