Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-34093: Stablize FLAG_REF usage (two-pass version) #8293

Closed
wants to merge 2 commits into from

Conversation

methane
Copy link
Member

@methane methane commented Jul 16, 2018

marshal used refcnt() to decide use FLAG_REF or not.

Even when one object is used only once in marshled object,
FLAG_REF could be used.

This commit makes marshal two-pass.  It counts refs
at first pass.  In second pass, mashal objects and
use FLAG_REF only when the object is used more than twice.
@methane
Copy link
Member Author

methane commented Jul 16, 2018

I don't like the option name stable, because it is very unclear what is stable.
It just helps reproducible pyc build.

@ericsnowcurrently
Copy link
Member

Wow, this is very similar to a PR I made for the same problem (before you pointed me here): gh-28379. The biggest difference is that I literally call w_object() twice, where the first pass determines how many times an object is used (and the result bytes are discarded).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants