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

aio-libs / multidict / 35610540304
87%

Build:
DEFAULT BRANCH: master
Ran 21 Sep 2026 02:12PM UTC
Jobs 1
Files 39
Run time 1min
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

21 Sep 2026 02:11PM UTC coverage: 87.498% (+0.02%) from 87.477%
35610540304

push

github

web-flow
Allocate deferred decrefs in fixed-size blocks (#1501)

<!-- Thank you for your contribution! -->

## What do these changes do?

Replaces the storage of `md_deferred_decref_t` (free-threaded build
only) with a chain of fixed-size blocks. Each block holds 511 object
pointers (4 KiB with the pointer) plus a `next` pointer. The first block
is inline in the struct and is always the tail of the chain; when it
fills, a heap block is prepended, so every block behind the current one
is full and `md_deferred_decref_release()` needs no per-block counts.
This drops the old 8-slot inline array and its doubling
`PyMem_Realloc`/`memcpy` growth path.

The GIL build and the pure-Python implementation do not use this
structure and are unaffected.

## Are there changes in behavior for the user?

No.

## Is it a substantial burden for the maintainers to support this?

No; the init/push/release API is unchanged and the implementation is
shorter than the previous one.

## Related issue number

N/A

## Checklist

- [x] I think the code is well written
- [x] Unit tests for the changes exist
- [x] Documentation reflects the changes (N/A, internal only)
- [ ] If you provide code modification, please add yourself to
`CONTRIBUTORS.txt` (N/A)
- [x] Add a new news fragment into the `CHANGES/` folder
- [x] `make doc-spelling` passes and any new technical words are added
to `docs/spelling_wordlist.txt`

Drafted with Claude Code (Claude Opus 5); reviewed by @asvetlov.

<details>
<summary>Agent run details (optional, for reviewers)</summary>

New test `test_replace_many_duplicates_releases_all` replaces 3000
duplicates via `__setitem__` and `update()` (about 9000 deferred
decrefs, many heap blocks) and checks via weakrefs that every old value
is released. Temporarily breaking the release walk to skip full blocks
makes it fail on the C extension.

- 3.14t, `MULTIDICT_DEBUG_BUILD=1`: 2066 passed, 18 skipped
- 3.14t, debug + `MULTIDICT_ASAN_BUILD=1` (`-k "not test_leak"`, no
`PYTHONMALL... (continued)

762 of 1524 branches covered (50.0%)

Branch coverage included in aggregate %.

14 of 14 new or added lines in 1 file covered. (100.0%)

6475 of 6747 relevant lines covered (95.97%)

1.92 hits per line

Jobs
ID Job ID Ran Files Coverage
1 MyPy - 35610540304.1 21 Sep 2026 02:12PM UTC 78
87.49
GitHub Action Run
Source Files on build 35610540304
  • Tree
  • List 39
  • Changed 3
  • Source Changed 1
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #35610540304
  • b37f07c1 on github
  • Prev Build on master (#35608724460)
  • Next Build on master (#35610986105)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc