You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We talked about introducing C++ either into the core implementation or as an optional dependency guarded by compile flags.
Everyone seemed OK with this in a vacuum, but we were worried about portability of all the features we cared about (with FreeBSD on unusual architectures being the point of concern).
We ought to have an opinion about whether or not the benefits of C++ will pay for its complexities.
I've been thinking about places I see where C++ would be useful, and I think the answer is mostly "templates":
The static_opts_t + JEMALLOC_FORCE_INLINE strategy (like the "bool fast" equivalent it replaced) is brittle, and strips the opportunity of the compiler to make inlining decisions. Morally, these should be template arguments.
No-overhead abstracting out of interfaces for testing. (E.g. we can test the tcache behavior against a mocked out arena).
Testing multiple configuration options without having to reconfigure and recompile.
There are some other advantages (I'm thinking namespaces, which could make name-mangling unnecessary, or member function syntax) but I think they'll tend to make things look cleaner rather than enabling us to do something we otherwise couldn't.
We've discussed this some offline, and our main concern relates to portability requirements especially in the context of embedding into FreeBSD's libc. I don't expect there to be any showstopping issues for the clang-based FreeBSD platforms, but it's possible that there are toolchain issues on the platforms based on gcc 4.2.
It is possible that all archs will have a working clang toolchain this year. The final push will be hard, but it will almost certainly be in 12-RELEASE.
Activity
davidtgoldblatt commentedon Jan 20, 2017
I've been thinking about places I see where C++ would be useful, and I think the answer is mostly "templates":
There are some other advantages (I'm thinking namespaces, which could make name-mangling unnecessary, or member function syntax) but I think they'll tend to make things look cleaner rather than enabling us to do something we otherwise couldn't.
jasone commentedon Feb 9, 2017
We've discussed this some offline, and our main concern relates to portability requirements especially in the context of embedding into FreeBSD's libc. I don't expect there to be any showstopping issues for the clang-based FreeBSD platforms, but it's possible that there are toolchain issues on the platforms based on gcc 4.2.
kev009 commentedon Feb 12, 2017
It is possible that all archs will have a working clang toolchain this year. The final push will be hard, but it will almost certainly be in 12-RELEASE.