Skip to content

Fix reference counting bug for dict values#353

Merged
hugovk merged 1 commit intoultrajson:masterfrom
quantopian:dict-val-mem-leak
Mar 3, 2020
Merged

Fix reference counting bug for dict values#353
hugovk merged 1 commit intoultrajson:masterfrom
quantopian:dict-val-mem-leak

Conversation

@richafrank
Copy link
Copy Markdown
Contributor

which meant a memory leak.

PyObject_GetItem returns a new reference (and goes through
abstract object[key] API), whereas PyDict_GetItem returns a borrowed
reference and goes directly to the dict hash lookup.

@hugovk
Copy link
Copy Markdown
Member

hugovk commented Mar 2, 2020

@richafrank Please could you resolve the merge conflict?

@hugovk hugovk added the changelog: Fixed For any bug fixes label Mar 2, 2020
which meant a memory leak.

PyObject_GetItem returns a new reference (and goes through
abstract object[key] API), whereas PyDict_GetItem returns a borrowed
reference and goes directly to the dict hash lookup.
@richafrank
Copy link
Copy Markdown
Contributor Author

Please could you resolve the merge conflict?

Done!

I also re-did the test to match the style of those added in #270. (They looked cleaner to me.)

@hugovk hugovk merged commit a399d93 into ultrajson:master Mar 3, 2020
@hugovk
Copy link
Copy Markdown
Member

hugovk commented Mar 3, 2020

Thank you!

@richafrank richafrank deleted the dict-val-mem-leak branch March 3, 2020 14:27
@hugovk hugovk mentioned this pull request Mar 4, 2020
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog: Fixed For any bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants