示例#1
0
 def consider_constant(self, TYPE, value):
     if value is not lltype.top_container(value):
         return
     if isinstance(TYPE, (lltype.GcStruct, lltype.GcArray)):
         p = value._as_ptr()
         if not self.gcheaderbuilder.get_header(p):
             hdr = self.gcheaderbuilder.new_header(p)
             hdr.refcount = sys.maxint // 2
             hdr.hash = lltype.identityhash_nocache(p)
示例#2
0
 def consider_constant(self, TYPE, value):
     if value is not lltype.top_container(value):
             return
     if isinstance(TYPE, (lltype.GcStruct, lltype.GcArray)):
         p = value._as_ptr()
         if not self.gcheaderbuilder.get_header(p):
             hdr = self.gcheaderbuilder.new_header(p)
             hdr.refcount = sys.maxint // 2
             hdr.hash = lltype.identityhash_nocache(p)
示例#3
0
 def common_gcheader_initdata(self, defnode):
     if defnode.db.gctransformer is not None:
         hdr = lltype.malloc(defnode.db.gctransformer.HDR, immortal=True)
         hdr.hash = lltype.identityhash_nocache(defnode.obj._as_ptr())
         return hdr._obj
     return None
示例#4
0
文件: gc.py 项目: e2pluginss/plexnet
 def common_gcheader_initdata(self, defnode):
     if defnode.db.gctransformer is not None:
         return [lltype.identityhash_nocache(defnode.obj._as_ptr())]
     else:
         return []
示例#5
0
文件: gc.py 项目: alkorzt/pypy
 def common_gcheader_initdata(self, defnode):
     if defnode.db.gctransformer is not None:
         return [lltype.identityhash_nocache(defnode.obj._as_ptr())]
     else:
         return []
示例#6
0
 def common_gcheader_initdata(self, defnode):
     if defnode.db.gctransformer is not None:
         hdr = lltype.malloc(defnode.db.gctransformer.HDR, immortal=True)
         hdr.hash = lltype.identityhash_nocache(defnode.obj._as_ptr())
         return hdr._obj
     return None