[Pyrex] some questions about extension types

Robby Dermody robbyd at u20.org
Tue Feb 22 03:35:55 CET 2005


--snip--
> Apparently, I can't take the address of an extension type's members. For
> instance, say I have
> cdef class Bla:
> 	cdef char myCString[50]
> 	cdef otherStruct* someData
> 
> bla = Bla()
> strncpy(bla.myCString, otherString, 50) #not allowed
> memcpy(bla.someData, foo, sizeof(otherStruct)) #also not allowed

Oops, I meant someData to be declared as:

cdef otherStruct someData, not cdef otherStruct* someData

nice way to cause memory garbling or a page fault. :)
--snip--




More information about the Pyrex mailing list