[Pyrex] creating and populating Python/C structs
Christopher Armstrong
radeex at gmail.com
Sun Sep 4 09:33:08 CEST 2005
On 9/5/05, Simon Burton <simon at arrowtheory.com> wrote:
> On Sun, 4 Sep 2005 16:44:08 +1000
> Christopher Armstrong <radeex at gmail.com> wrote:
>
> >
> > Anyway, one issue is that I'm trying to avoid PyFrame_New, which gets
> > a bunch of stuff from the context (e.g. the thread state you're
> > supposed to pass it) and I want to avoid that. I guess I can just try
> > to duplicate what it does without all the extra stuff. I guess that
> > means using PyObject_GC_NewVar.... I'll thrash around a bit more and
> > see if I can get any further.
> does it work ?
Yes, that worked (although the point of the c_frame local eludes me).
However, I still need to avoid PyFrame_New because it's getting the
current frame from the threadstate and linking it to the created
frame. I'm trying to create a "fake" frame object that doesn't have
references to any real objects so that I can keep it around for a
while without screwing up GC.
hrmm.... On the other hand, perhaps I can get a frame from
PyFrame_New, and then just decref and replace its f_back member....
Thanks a lot for the help! I'm ever closer to my goal.
--
Twisted | Christopher Armstrong: International Man of Twistery
Radix | -- http://radix.twistedmatrix.com
| Release Manager, Twisted Project
\\\V/// | -- http://twistedmatrix.com
|o O| |
w----v----w-+
More information about the Pyrex
mailing list