Skip to content

Add default ctor ability to gc policy's edit #297

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jeaye
Copy link

@jeaye jeaye commented Mar 13, 2025

This code was incorrect before, from everything I can tell. I suspect a Clang issue for why it never failed before. It boils down to this:

What I did to make it show up:

  • I moved my immer map, vector, set instantiations to an extern template, with one definition in a .cpp file

Originally, I fixed this by changing {} to {nullptr}, but that won't work for other policies, such as this: https://github.com/arximboldi/immer/blob/master/immer/transience/no_transience_policy.hpp#L24

Instead, I have made the GC policy's edit default constructible. The void* ctor was removed, since aggregate initialization can now just be used instead.

@jeaye
Copy link
Author

jeaye commented Mar 20, 2025

@arximboldi Any interest in this fix?

@arximboldi
Copy link
Owner

Hi @jeaye ! I am interested in this. I just wanted to find some time to study this commit properly to see if there are any potential unwanted cosequences.

I also wanted to look deeper into this, which I've wondered if it is related. I wonder whether there are current bugs when using gc_transience_policy, as it is less common in the production systems I've seen. NixOS/nix#11767 (comment)

@jeaye
Copy link
Author

jeaye commented Mar 21, 2025

I also wanted to look deeper into this, which I've wondered if it is related. I wonder whether there are current bugs when using gc_transience_policy, as it is less common in the production systems I've seen. NixOS/nix#11767 (comment)

Ah, this would be very good to know. Please let me know what you discover, or if you need any help testing. There's no rush to merge this for jank, since we're running on our fork of immer. Just wanted to make sure this had some momentum and I see now that it does. 🙂

Thank you, Juanpe!

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 this pull request may close these issues.

2 participants