Did I find the right examples for you? yes no

All Samples(17)  |  Call(12)  |  Derive(0)  |  Import(5)

src/s/y/Sypy-HEAD/rlib/_rweakvaldict.py   Sypy(Download)
from pypy.objspace.flow.model import Constant
from pypy.rpython.lltypesystem import lltype, llmemory, rstr, rclass, rdict
from pypy.rpython.lltypesystem.llmemory import weakref_create, weakref_deref
from pypy.rpython.lltypesystem.lloperation import llop
from pypy.rpython.rclass import getinstancerepr
        def ll_valid(entries, i):
            value = entries[i].value
            return bool(value) and bool(weakref_deref(rclass.OBJECTPTR, value))
 
        def ll_everused(entries, i):
        valueref = d.entries[i].value
        if valueref:
            return weakref_deref(rclass.OBJECTPTR, valueref)
        else:
            return lltype.nullptr(rclass.OBJECTPTR.TO)

src/p/l/plexnet-HEAD/third_party/generic/pypy/pypy/rlib/rweakrefimpl.py   plexnet(Download)
from pypy.objspace.flow.model import Constant
from pypy.rpython.lltypesystem import lltype, llmemory, rstr, rclass, rdict
from pypy.rpython.lltypesystem.llmemory import weakref_create, weakref_deref
from pypy.rpython.lltypesystem.lloperation import llop
from pypy.rpython.rclass import getinstancerepr
def ll_valid(entries, i):
    return (bool(entries[i].value) and
            bool(weakref_deref(rclass.OBJECTPTR, entries[i].value)))
 
def ll_everused(entries, i):
    valueref = d.entries[i].value
    if valueref:
        return weakref_deref(rclass.OBJECTPTR, valueref)
    else:
        return lltype.nullptr(rclass.OBJECTPTR.TO)

src/s/y/Sypy-HEAD/rlib/_rweakkeydict.py   Sypy(Download)
from pypy.objspace.flow.model import Constant
from pypy.rpython.lltypesystem import lltype, llmemory, rclass, rdict
from pypy.rpython.lltypesystem.llmemory import weakref_create, weakref_deref
from pypy.rpython.lltypesystem.lloperation import llop
from pypy.rpython.rclass import getinstancerepr
def ll_valid(entries, i):
    key = entries[i].key
    if not key:
        return False
    elif weakref_deref(rclass.OBJECTPTR, key):
        assert bool(realkey2)
        return False
    return weakref_deref(rclass.OBJECTPTR, weakkey1) == realkey2
 
@jit.dont_look_inside

src/p/l/plexnet-HEAD/third_party/generic/pypy/pypy/rpython/lltypesystem/llheap.py   plexnet(Download)
# only for the LLInterpreter.  Don't use directly.
 
from pypy.rpython.lltypesystem.lltype import pyobjectptr, malloc, free, typeOf
from pypy.rpython.lltypesystem.llmemory import weakref_create, weakref_deref
 

src/s/y/Sypy-HEAD/rpython/lltypesystem/llheap.py   Sypy(Download)
# only for the LLInterpreter.  Don't use directly.
 
from pypy.rpython.lltypesystem.lltype import pyobjectptr, malloc, free, typeOf
from pypy.rpython.lltypesystem.llmemory import weakref_create, weakref_deref
 

src/p/l/plexnet-HEAD/third_party/generic/pypy/pypy/rpython/test/test_rweakref.py   plexnet(Download)
        def g():
            s = lltype.malloc(S)
            w = llmemory.weakref_create(s)
            assert llmemory.weakref_deref(lltype.Ptr(S), w) == s
            assert llmemory.weakref_deref(lltype.Ptr(S), w) == s
            return w   # 's' is forgotten here
        def f():
            w = g()
            rgc.collect()
            return llmemory.weakref_deref(lltype.Ptr(S), w)

src/s/y/Sypy-HEAD/rpython/test/test_rweakref.py   Sypy(Download)
        def g():
            s = lltype.malloc(S)
            w = llmemory.weakref_create(s)
            assert llmemory.weakref_deref(lltype.Ptr(S), w) == s
            assert llmemory.weakref_deref(lltype.Ptr(S), w) == s
            return w   # 's' is forgotten here
        def f():
            w = g()
            rgc.collect()
            return llmemory.weakref_deref(lltype.Ptr(S), w)