Skip to content

Figure out C++ story #534

Open
Open

Description

@davidtgoldblatt

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.

Activity

  1. davidtgoldblatt commented on Jan 20, 2017

    @davidtgoldblatt
    ContributorAuthor

    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.

  2. added this to the 5.1.0 milestone on Feb 9, 2017
  3. jasone commented on Feb 9, 2017

    @jasone
    Member

    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.

  4. kev009 commented on Feb 12, 2017

    @kev009

    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.

  5. modified the milestones: 5.1.0, 5.2.0 on Apr 11, 2018
  6. modified the milestones: 5.2.0, 6.0 on Apr 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions