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

Deprecate the garbage collector? #145

Open
dcreager opened this issue Jul 30, 2018 · 2 comments
Open

Deprecate the garbage collector? #145

dcreager opened this issue Jul 30, 2018 · 2 comments

Comments

@dcreager
Copy link
Owner

Is anyone using the garbage collector? I've never used it in anger, and to be honest, I'm not sure if it belongs in this kind of low-level library. If not, I'd like to remove it before cutting a stable 1.0.0 release.

@ghost
Copy link

ghost commented Oct 11, 2018

My 2c on this as a huge fan of this library: I really like the idea of the garbage collector, however things get complicated by the fact that it's not thread-safe, which means having a collector per-thread and preventing any sharing of objects across threads. If the collector was thread safe, there would be a significant advantage to its existence over memory pools, which is that it would massively simplify shared ownership of heap objects.

If you're doing shared ownership with objects allocated from a memory pool, you basically have to ensure architecturally that an object is returned to the pool at the correct time. With the garbage collector however, it'll just happen as soon as all the references are cleared, which is very useful. Doing multi-threaded GC is tricky though, and I can imagine it's not particularly feasible for a library like this.

@solvingj
Copy link

If you do remove it, maybe you could verify compatibility, and add some integration tests, and maybe an example or two using:

https://github.com/ivmai/bdwgc/

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