Skip to content

PyPy support #1

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

Merged
merged 3 commits into from
Jan 2, 2013
Merged

PyPy support #1

merged 3 commits into from
Jan 2, 2013

Conversation

nelhage
Copy link
Contributor

@nelhage nelhage commented Dec 10, 2012

This branch makes python-zephyr work properly under PyPy, and fixes an admittedly-obscure bug under CPython. Not super-heavily tested, but san-checked.

Cython is a fork that is better-maintained, and has better PyPy
support. PyZephyr is simple enough that the switch appears to require
no code changes.
@nelhage
Copy link
Contributor Author

nelhage commented Dec 15, 2012

CC: @timabbott

@timabbott
Copy link
Collaborator

"Explicitly hold references to PyObject_s after conversion to char_."

references in the commit message an "object poo", which is presumably intended to be a "pool"

Otherwise, lgtm.

If we are holding onto the char* version of a PyObject*, we need to
hold a reference to that PyObject itself. In CPython, the previous
code generally works because the ZNotice object would hold a reference
from __dict__. This assumption is not true in PyPy, and would also
break in weirder cases like someone subclassing ZNotice and replacing
'cls' with a property.

We can't just hold the objects in a Python list, because again, in
PyPy, that results in conversion to PyPy's internal format, which does
not hold onto the specific PyObject* generated by cpyext. So instead,
write some C code to maintain an object pool of objects to which we
need references.
@nelhage
Copy link
Contributor Author

nelhage commented Jan 1, 2013

Fixed!

On Mon, Dec 31, 2012 at 3:42 PM, Tim Abbott notifications@github.comwrote:

"Explicitly hold references to PyObject_s after conversion to char_."

references in the commit message an "object poo", which is presumably
intended to be a "pool"

Otherwise, lgtm.


Reply to this email directly or view it on GitHubhttps://github.com//pull/1#issuecomment-11783751.

@timabbott
Copy link
Collaborator

Evan, do you want to review this, or should I go ahead and merge?

@ebroder
Copy link
Owner

ebroder commented Jan 1, 2013

I've skimmed it. Little bit sad that that's necessary, but seems fine. (Also fine with not having these go through me)

timabbott added a commit that referenced this pull request Jan 2, 2013
@timabbott timabbott merged commit 1a7ee3e into ebroder:master Jan 2, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants