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

Making container node sizes optional? #143

Closed
weefuzzy opened this issue Oct 6, 2022 · 3 comments
Closed

Making container node sizes optional? #143

weefuzzy opened this issue Oct 6, 2022 · 3 comments

Comments

@weefuzzy
Copy link

weefuzzy commented Oct 6, 2022

Hello, I have questions about the container node sizes stuff, motivated by (a) not really grasping what exactly it's for and (b) the amount of time it's adding to my configure step every time I re-run CMake.

  • It seems like before Mcross/cmake node size #129 this step was optional, based on the value of FOONATHAN_MEMORY_BUILD_TOOLS, but now it runs get_container_node_sizes unconditionally on every CMake invocation. Is this correct? And is it necessary?
  • If it really can't be made optional, is there a case for only running on the first invocation of CMake? Presumably, for a given toolchain, the things it discovers will remain constant. I guess one could use an internal cache variable as a flag – happy to submit a PR if that seems like a useful thing.

Perhaps relevant:

  • I'm pulling in the memory library using CMake FetchContent and then doing add_subdirectory with EXCLUDE_FROM_ALL. Perhaps this is too off-label. It just happens to be the way I get the other dependencies for my project.
  • I'm not (yet) doing anything sophisticated with memory, like making my own pools. I'm just using it to get polymorphic-memory-resource like behaviour so I can switch between a small number of pre-existing allocators.
@Ipiano
Copy link

Ipiano commented Oct 6, 2022

Seconding this - I'm having the exact same issue. I don't know what might cause the size of nodes to change between builds, but it seems to me like get_container_node_sizes should be able to short circuit if outfile already exists? Maybe it needs to cache some settings values such that it can determine if the file needs to be regenerated? Depending on what exactly could cause the node size to change, it might be acceptable to just require that if the user needs to recalculate it, they need to do a clean build with new settings

@foonathan
Copy link
Owner

The header is no longer re-generated if it already exists. If someone wants to do more sophisticated guarding against CMake changes (I don't know whether it's necessary), feel free to do a PR.

If you want to disable the header entirely, it is enough to use CMake to create an empty file at that location.

@weefuzzy
Copy link
Author

weefuzzy commented Oct 7, 2022

That's great, thank you!

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

3 participants