Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#41 closed defect (fixed)

Bug accessing internals of Python long

Reported by: casevh@… Owned by: somebody
Priority: critical Milestone: 0.9.8.1
Component: Code Generation Keywords: MESSAGE
Cc: Quatre, Bornes

Description

I am trying to access the internal structure of a Python long. The code
fragment below works when I use Pyrex 0.9.8.4 but generates a compile error
when using Cython 0.9.8.


The code:

cdef extern from "Python.h":

ctypedef struct PyTypeObject?:

pass

ctypedef struct PyObject?:

Py_ssize_t ob_refcnt
PyTypeObject? * ob_type

cdef extern from "longintrepr.h":

cdef struct _longobject:

int ob_refcnt
PyTypeObject? * ob_type
int ob_size
unsigned int * ob_digit

def test(temp = long(0)):

cdef _longobject *l
l = <_longobject *> temp
print sizeof(l.ob_size)
print sizeof(l.ob_digit[0])

Change History (5)

comment:1 Changed 6 years ago by robertwb

  • Priority changed from major to critical

comment:2 Changed 6 years ago by robertwb

This is due to #51

comment:3 Changed 6 years ago by robertwb

  • Resolution set to fixed
  • Status changed from new to closed

comment:4 Changed 6 years ago by robertwb

  • Milestone set to 0.9.8.1

comment:5 Changed 6 years ago by SRJamess

  • Cc Quatre Bornes added
  • Keywords MESSAGE added

broadway music indiana merriville
<a href=http://chiara-civello.meh6.co.cc/map.html>hawaiian styles of music </a>

<a href=http://throneum.gretpol.co.cc/map.html> carman free music download</a>
http://n-sync.allorg.co.cc/map.html instamental song music

http://retro---various-artists.umehon.co.cc/map.html music metre cabal
http://bethlehem.meh6.co.cc/map.html york pa live music

Note: See TracTickets for help on using tickets.