[Cython] How should be C-clobal deletion handled?

Robert Bradshaw robertwb at gmail.com
Sat May 25 08:34:22 CEST 2013


On Thu, May 23, 2013 at 10:02 PM, Vitja Makarov <vitja.makarov at gmail.com> wrote:
> Hi!
>
> Recently I've found that the following code causes segmentation fault:
>
> cdef object f
> del f
> print f
>
> So the question is: how should that work?
>
> global objects are implicitly initialized to None and no CF and no cf
> analysis is performed for it.
>
> So I see three options here:
>
> 1. prohibit cglobal deletion
> 2. set it back to None
> 3. check for a null value at every reference and assignment

I'd go for 1, with 2 as a backup option.

- Robert


More information about the cython-devel mailing list