Skip to content

core-cpp 0.4.2

Choose a tag to compare

@github-actions github-actions released this 26 Sep 00:17
· 58 commits to master since this release

Added

  • core::log::ScopedCapture::snapshot(): a copy of what the capture holds, taken under its
    lock, for reading while other threads still log into it. text() is unchanged -- a reference to
    the buffer itself -- and is valid only while no thread logs into the capture, once the writers
    are joined.

Fixed

  • core::log::ScopedCapture takes lines from several threads at once. Its sink appended to a
    std::string without a lock, so a test whose code logged from two threads corrupted the heap
    (contour's Windows test crash). Every append now takes a mutex, and so do contains(),
    count(), lines() and the new snapshot(). No signature changes.
  • DetachedTask no longer reads a freed frame under clang-cl at -O0 (core-cpp#51). A
    trivial empty return object is returned in a register, and clang-cl without optimisation kept the
    starting call's copy of it in the coroutine frame and reloaded it from there after the first
    suspension. When that suspension handed the coroutine to something that ran it to its end first
    -- a pool thread, an event loop on another thread, an await_suspend that resumes inline -- the
    frame was already freed. fastcached's shutdown flows, which hop onto a loop from another thread
    and finish there, have this shape. DetachedTask's destructor is now defaulted out of line,
    which makes it user-provided, so every ABI returns it through a pointer the caller owns. The type
    is no longer trivially destructible, trivially copyable or an aggregate; DetachedTask{} still
    works through its default constructor, and its members and behaviour are unchanged.

Full Changelog: v0.4.1...v0.4.2