• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

xlnt-community / xlnt / 8cf07b4b-80d1-4792-a6ab-0460b2e091f2 / 1
84%
master: 84%

Build:
DEFAULT BRANCH: master
Ran 25 Oct 2025 08:00AM UTC
Files 115
Run time 3s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

25 Oct 2025 07:56AM UTC coverage: 82.565% (+0.3%) from 82.278%
8cf07b4b-80d1-4792-a6ab-0460b2e091f2.1

push

circleci

web-flow
Fix garbage collection of formats (#115)

`format_impl_ptr` is now used instead of a `format_impl*`. All reference
counting is delegated to format_impl_ptr.

`format_impl_ptr` triggers garbage collection when reference count drops
to zero. Previously, garbage collection was run too often, resulting in
a significant overhead when reading many formats (see benchmark-styles).

`format_impl` is owned by the stylesheet iff `format_impl::stylesheet
!== nullptr` If the format is still referenced while the stylesheet is
cleared/destructed, ownership is delegated to `format_impl_ptr` by
setting `format_impl::stylesheet = nullptr`. This may occur when a
`xlnt::format` object still exists when the workbook is cleared.

`format_impl_ptr` implements a custom smart pointer, instead of using
the traditional `std::shared_ptr` / `std::weak_ptr` approach, to allow
better control over the garbage collection process. Garbage collection
should not run when parsing an xlsx file, even not after the document is
fully read, to support a successful round trip, preserving even unused
formats. See the many `round_trip_matches_rw` tests.

`xlnt::format`: return a reference to this, instead of creating
unnecessary copies. The intention seemed to be to create a fluent
interface, but this requires a reference to be returned, as the
`xlnt::format` copy constructor performs a deep (lazy) copy. It's not a
wrapper like e.g. `xlnt::cell.`

`xlnt::detail::references`: implements reference counting for an object.
Copy constructor does not copy the count to the new object, as it is a
new object requiring its own reference counting.

`xlnt::workbook::empty`: `create_format(true)` returns a copy of the
created format. Modifying the returned format, doesn't actually change
the default format itself. Previously this was the case, due to quirks
in the reference counting mechanism.

Fixes #93

14324 of 18832 branches covered (76.06%)

11763 of 14247 relevant lines covered (82.56%)

10760.65 hits per line

Source Files on job 8cf07b4b-80d1-4792-a6ab-0460b2e091f2.1
  • Tree
  • List 115
  • Changed 11
  • Source Changed 9
  • Coverage Changed 10
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 8
  • 114ca851 on github
  • Prev Job for on master (#c3aa2f57-b7e9-432c-bc93-31410b51fefe.1)
  • Next Job for on master (#e58f5686-3d59-405f-a5b9-190a8378a5bd.1)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc