◐ Shell
clean mode source ↗

gh-132983: Reduce the size of `_zstdmodule.h` by AA-Turner · Pull Request #133793 · python/cpython

@AA-Turner

@AA-Turner AA-Turner commented

May 10, 2025

edited by bedevere-app Bot

Loading

We should try and reduce the content in the header file, as it is exposed to anything that includes it.

  • mt_continue_should_break() moves into compressor.c
  • The decompress_type enum moves into decompressor.c
  • Replace #pragma once (not used for any other modules or non-vendored code) with guard defines
  • Use angle-bracket includes for z{std,dict}.h
  • Add a zstddict.h header file to contain the definition of the ZstdDict struct
  • Move the ZstdCompressor struct to compressor.c (likewise for decompressor)
  • Make PyModuleDef _zstdmodule static

A

emmatyping

@hugovk hugovk changed the title GH-132983: Reduce the size of _zstdmodule.h gh-132983: Reduce the size of _zstdmodule.h

May 10, 2025

@hugovk

picnixz

emmatyping

picnixz

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's fun that the diff for reducing the size is +165/-164.

@miss-islington-app

Thanks @AA-Turner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request

May 10, 2025
(cherry picked from commit 1a548c0)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>

@bedevere-app

AA-Turner added a commit that referenced this pull request

May 10, 2025
…133854)

gh-132983: Reduce the size of ``_zstdmodule.h`` (GH-133793)
(cherry picked from commit 1a548c0)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>

Pranjal095 pushed a commit to Pranjal095/cpython that referenced this pull request

Jul 12, 2025

taegyunkim pushed a commit to taegyunkim/cpython that referenced this pull request

Aug 4, 2025