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

Since multidicts can be inherited they should call tp_free slot explicitly #407

Merged
merged 3 commits into from Nov 24, 2019

Conversation

asvetlov
Copy link
Member

No description provided.

@psf-chronographer psf-chronographer bot added the bot:chronographer:provided There is a change note present in this PR label Nov 24, 2019
@codecov
Copy link

codecov bot commented Nov 24, 2019

Codecov Report

Merging #407 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #407   +/-   ##
=======================================
  Coverage   75.15%   75.15%           
=======================================
  Files           5        5           
  Lines         471      471           
=======================================
  Hits          354      354           
  Misses        117      117

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c638532...a6b2bb0. Read the comment docs.

@@ -589,7 +589,7 @@ multidict_tp_dealloc(MultiDictObject *self)
PyObject_ClearWeakRefs((PyObject *)self);
};
pair_list_dealloc(&self->pairs);
PyObject_GC_Del(self);
Py_TYPE(self)->tp_free((PyObject *)self);
Copy link
Contributor

Choose a reason for hiding this comment

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

What about adding macro #define MultiDictTpFree(ob) (Py_TYPE(ob)->tp_free((PyObject *)ob)) ?

Copy link
Member Author

Choose a reason for hiding this comment

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

This macro will be used at most twice: once for MultiDict/CIMultiDict and once for their proxies.
Do we really need the macro for such a case?
The expanded version is better readable from my perspective.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, you right.

@asvetlov asvetlov merged commit 42deec8 into master Nov 24, 2019
@asvetlov asvetlov deleted the tp_free branch November 24, 2019 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot:chronographer:provided There is a change note present in this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants