Alex Gaynor  committed 5881a4c

remove some references to cpy, the old allocation flavor for PyObject

  • Participants
  • Parent commits a16325a
  • Branches kill-someobject

Comments (0)

Files changed (3)

File pypy/rpython/memory/gctransform/

             return self.static_deallocator_funcptrs[TYPE]
-        if TYPE._gckind == 'cpy':
-            return # you don't really have an RPython deallocator for PyObjects
-        rtti = get_rtti(TYPE) 
+        rtti = get_rtti(TYPE)
         if rtti is not None and hasattr(rtti._obj, 'destructor_funcptr'):
             destrptr = rtti._obj.destructor_funcptr
             DESTR_ARG = lltype.typeOf(destrptr).TO.ARGS[0]
         return fptr
     def dynamic_deallocation_funcptr_for_type(self, TYPE):
-        assert TYPE._gckind != 'cpy'
         if TYPE in self.dynamic_deallocator_funcptrs:
             return self.dynamic_deallocator_funcptrs[TYPE]

File pypy/rpython/memory/gctransform/

         if add_flags:
         flavor = flags['flavor']
-        assert flavor != 'cpy', "cannot malloc CPython objects directly"
         meth = getattr(self, 'gct_fv_%s_malloc_varsize' % flavor, None)
         assert meth, "%s has no support for malloc_varsize with flavor %r" % (self, flavor) 
         return self.varsize_malloc_helper(hop, flags, meth, [])
         flags = op.args[1].value
         flavor = flags['flavor']
         v = op.args[0]
-        assert flavor != 'cpy', "cannot free CPython objects directly"
         if flavor == 'raw':
             v = hop.genop("cast_ptr_to_adr", [v], resulttype=llmemory.Address)
             if flags.get('track_allocation', True):

File pypy/rpython/

             isinstance(T.TO, (lltype.Struct,
-            assert T.TO._gckind != 'cpy'
             return DummyValueBuilder(rtyper, T.TO)
             return None
     def rtype_bltn_list(self, hop):
-        raise TyperError, 'no list() support for %r' % self
+        raise TyperError('no list() support for %r' % self)
     def rtype_unichr(self, hop):
-        raise TyperError, 'no unichr() support for %r' % self
+        raise TyperError('no unichr() support for %r' % self)
     # default implementation of some operations