Did I find the right examples for you? yes no

All Samples(368)  |  Call(362)  |  Derive(0)  |  Import(6)

src/p/l/plexnet-HEAD/third_party/generic/pypy/pypy/rpython/memory/gc/marksweep.py   plexnet(Download)
            next = hdr.next
            typeid = hdr.typeid16
            gc_info = llmemory.cast_ptr_to_adr(hdr)
            obj = gc_info + size_gc_header
            if not hdr.mark:
                self.add_reachable_to_stack(obj, objects)
            addr = llmemory.cast_ptr_to_adr(hdr)
        # also mark self.curpool
        if self.curpool:
            gc_info = llmemory.cast_ptr_to_adr(self.curpool) - size_gc_header
            hdr = llmemory.cast_adr_to_ptr(gc_info, self.HDRPTR)
            hdr.mark = True
            typeid = hdr.typeid16
            next = hdr.next
            addr = llmemory.cast_ptr_to_adr(hdr)
            size = self.fixed_size(typeid)
            estimate = raw_malloc_usage(size_gc_header + size)
            if hdr.mark:
                offset = self.weakpointer_offset(typeid)
                hdr.mark = False
                gc_info = llmemory.cast_ptr_to_adr(hdr)

src/s/y/Sypy-HEAD/rpython/memory/gc/marksweep.py   Sypy(Download)
            next = hdr.next
            typeid = hdr.typeid16
            gc_info = llmemory.cast_ptr_to_adr(hdr)
            obj = gc_info + size_gc_header
            if not hdr.mark:
                self.add_reachable_to_stack(obj, objects)
            addr = llmemory.cast_ptr_to_adr(hdr)
        # also mark self.curpool
        if self.curpool:
            gc_info = llmemory.cast_ptr_to_adr(self.curpool) - size_gc_header
            hdr = llmemory.cast_adr_to_ptr(gc_info, self.HDRPTR)
            hdr.mark = True
            typeid = hdr.typeid16
            next = hdr.next
            addr = llmemory.cast_ptr_to_adr(hdr)
            size = self.fixed_size(typeid)
            estimate = raw_malloc_usage(size_gc_header + size)
            if hdr.mark:
                offset = self.weakpointer_offset(typeid)
                hdr.mark = False
                gc_info = llmemory.cast_ptr_to_adr(hdr)

src/p/l/plexnet-HEAD/third_party/generic/pypy/pypy/rpython/memory/gcwrapper.py   plexnet(Download)
    def setfield(self, obj, fieldname, fieldvalue):
        STRUCT = lltype.typeOf(obj).TO
        addr = llmemory.cast_ptr_to_adr(obj)
        addr += llmemory.offsetof(STRUCT, fieldname)
        self.setinterior(obj, addr, getattr(STRUCT, fieldname), fieldvalue)
 
    def setarrayitem(self, array, index, newitem):
        ARRAY = lltype.typeOf(array).TO
        addr = llmemory.cast_ptr_to_adr(array)
    def setinterior(self, toplevelcontainer, inneraddr, INNERTYPE, newvalue):
        if (lltype.typeOf(toplevelcontainer).TO._gckind == 'gc' and
            isinstance(INNERTYPE, lltype.Ptr) and INNERTYPE.TO._gckind == 'gc'):
            self.gc.write_barrier(llmemory.cast_ptr_to_adr(newvalue),
                                  llmemory.cast_ptr_to_adr(toplevelcontainer))
        addr = self.gc.malloc(type_id, None, zero=False)
        result = llmemory.cast_adr_to_ptr(addr, gctypelayout.WEAKREFPTR)
        result.weakptr = llmemory.cast_ptr_to_adr(objgetter())
        return llmemory.cast_ptr_to_weakrefptr(result)
 

src/s/y/Sypy-HEAD/rpython/memory/gcwrapper.py   Sypy(Download)
    def shrink_array(self, p, smallersize):
        if hasattr(self.gc, 'shrink_array'):
            addr = llmemory.cast_ptr_to_adr(p)
            return self.gc.shrink_array(addr, smallersize)
        return False
    def setfield(self, obj, fieldname, fieldvalue):
        STRUCT = lltype.typeOf(obj).TO
        addr = llmemory.cast_ptr_to_adr(obj)
        addr += llmemory.offsetof(STRUCT, fieldname)
        self.setinterior(obj, addr, getattr(STRUCT, fieldname), fieldvalue)
 
    def setarrayitem(self, array, index, newitem):
        ARRAY = lltype.typeOf(array).TO
        addr = llmemory.cast_ptr_to_adr(array)
                                or lltype.typeOf(index) == lltype.Signed)
                        self.gc.write_barrier_from_array(
                            llmemory.cast_ptr_to_adr(newvalue),
                            llmemory.cast_ptr_to_adr(toplevelcontainer),
                            index)

src/p/l/plexnet-HEAD/third_party/generic/pypy/pypy/rpython/lltypesystem/rffi.py   plexnet(Download)
import py
from pypy.annotation import model as annmodel
from pypy.rpython.lltypesystem import lltype
from pypy.rpython.lltypesystem import ll2ctypes
from pypy.rpython.lltypesystem.llmemory import cast_adr_to_ptr, cast_ptr_to_adr
            return buf
        else:
            data_start = cast_ptr_to_adr(llstrtype(data)) + \
                offsetof(STRTYPE, 'chars') + itemoffsetof(STRTYPE.chars, 0)
            return cast(TYPEP, data_start)
        gc_buf = rgc.malloc_nonmovable(STRTYPE, count)
        if gc_buf:
            realbuf = cast_ptr_to_adr(gc_buf) + str_chars_offset
            raw_buf = cast(TYPEP, realbuf)
            return raw_buf, gc_buf
                                itemoffsetof(STRTYPE.chars, 0))
            if gc_buf:
                src = cast_ptr_to_adr(gc_buf) + str_chars_offset
            else:
                src = cast_ptr_to_adr(raw_buf) + itemoffsetof(TYPEP.TO, 0)

src/p/l/plexnet-HEAD/third_party/generic/pypy/pypy/translator/goal/targetlbench.py   plexnet(Download)
 
from pypy.rpython.lltypesystem import lltype
from pypy.rpython.lltypesystem.llmemory import cast_ptr_to_adr, raw_memclear,\
     raw_memcopy, sizeof, itemoffsetof
 
        onesize = sizeof(TP.OF)
        size = baseofs + onesize*(size - 1)
        raw_memcopy(cast_ptr_to_adr(b)+baseofs, cast_ptr_to_adr(a)+baseofs, size)
    else:
        a = []

src/p/l/plexnet-HEAD/third_party/generic/pypy/pypy/rpython/llinterp.py   plexnet(Download)
    def getinneraddr(self, obj, *offsets):
        TYPE = lltype.typeOf(obj).TO
        addr = llmemory.cast_ptr_to_adr(obj)
        for o in offsets:
            if isinstance(o, str):
    def op_cast_ptr_to_adr(self, ptr):
        checkptr(ptr)
        return llmemory.cast_ptr_to_adr(ptr)
 
    def op_cast_adr_to_int(self, adr):
    def op_gc_can_move(self, ptr):
        addr = llmemory.cast_ptr_to_adr(ptr)
        return self.heap.can_move(addr)
 
    def op_gc_thread_prepare(self):
    def __getitem__(self, index):
        if index != 0:
            raise IndexError("address of local vars only support [0] indexing")
        p = self.frame.getval(self.v)
        result = llmemory.cast_ptr_to_adr(p)

src/s/y/Sypy-HEAD/rpython/lltypesystem/rffi.py   Sypy(Download)
import py
from pypy.annotation import model as annmodel
from pypy.rpython.lltypesystem import lltype
from pypy.rpython.lltypesystem import ll2ctypes
from pypy.rpython.lltypesystem.llmemory import cast_adr_to_ptr, cast_ptr_to_adr
            return buf
        else:
            data_start = cast_ptr_to_adr(llstrtype(data)) + \
                offsetof(STRTYPE, 'chars') + itemoffsetof(STRTYPE.chars, 0)
            return cast(TYPEP, data_start)
        # 'buf' points to its own raw-malloced memory.
        data = llstrtype(data)
        data_start = cast_ptr_to_adr(data) + \
            offsetof(STRTYPE, 'chars') + itemoffsetof(STRTYPE.chars, 0)
        followed_2nd_path = (buf == cast(TYPEP, data_start))
                            itemoffsetof(STRTYPE.chars, 0))
        if gc_buf:
            src = cast_ptr_to_adr(gc_buf) + str_chars_offset
        else:
            src = cast_ptr_to_adr(raw_buf) + itemoffsetof(TYPEP.TO, 0)

src/p/l/plexnet-HEAD/third_party/generic/pypy/pypy/rpython/memory/gc/hybrid.py   plexnet(Download)
        else:
            raise NotImplementedError("Not supported")
        return llmemory.cast_ptr_to_adr(gcref)
 
    def realloc(self, ptr, newlength, fixedsize, itemsize, lengthofs, grow):
        size_gc_header = self.size_gc_header()
        addr = llmemory.cast_ptr_to_adr(ptr)
    def id(self, ptr):
        obj = llmemory.cast_ptr_to_adr(ptr)
 
        # is it a tagged pointer?
        if not self.is_valid_gc_object(obj):

src/s/y/Sypy-HEAD/translator/goal/targetlbench.py   Sypy(Download)
 
from pypy.rpython.lltypesystem import lltype
from pypy.rpython.lltypesystem.llmemory import cast_ptr_to_adr, raw_memclear,\
     raw_memcopy, sizeof, itemoffsetof
 
        onesize = sizeof(TP.OF)
        size = baseofs + onesize*(size - 1)
        raw_memcopy(cast_ptr_to_adr(b)+baseofs, cast_ptr_to_adr(a)+baseofs, size)
    else:
        a = []

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next