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

Implement garbage collection using libgc #952

Closed
plajjan opened this issue Oct 6, 2022 · 2 comments
Closed

Implement garbage collection using libgc #952

plajjan opened this issue Oct 6, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@plajjan
Copy link
Contributor

plajjan commented Oct 6, 2022

Proposal

Use libgc for garbage collection!

Motivation

Acton needs a GC!

Alternatives

Naturally the long term solution is a custom GC for Acton that interoperates well with other parts of Acton providing the best solution for performance etc. In the meantime, any GC is better than no GC.

@plajjan plajjan added the enhancement New feature or request label Oct 6, 2022
@plajjan
Copy link
Contributor Author

plajjan commented Oct 7, 2022

@aagapi I'd like your input on one topic. The DB client needs to malloc things with GC, just like the rest of RTS. It doesn't matter if it's libgc, which I'm trying to implement here, or if it is the longer term custom-written GC for Acton, we still need to use a GC_MALLOC.

I haven't looked in detail at how DB client mallocs stuff but I presume it mallocs, like when we get respone data from DB we have to malloc that up right.

There are shared files between the DB client and actondb. I assume that you want manual memory management in actondb. I think this means we need to compile these support files twice, once for actondb with standard malloc and once for DB client with GC_MALLOC. I can set up the Makefile stuff for that but I do have to inject which malloc to use, so my suggestion is to replace all mallocs, callos, reallocs & free with like ACT_MALLOC, ACT_CALLOC etc, and then I can define this as a macro depending on how I am compiling it.

What do you think? would this be an acceptable approach or do you see a better alternative?

@plajjan
Copy link
Contributor Author

plajjan commented Nov 14, 2022

Fixed by #964. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant