Did I find the right examples for you? yes no

All Samples(181)  |  Call(178)  |  Derive(0)  |  Import(3)

src/p/l/plexnet-HEAD/third_party/generic/pypy/pypy/jit/backend/llsupport/symbolic.py   plexnet(Download)
def get_size(TYPE, translate_support_code):
    if translate_support_code:
        if TYPE._is_varsize():
            return llmemory.sizeof(TYPE, 0)
        return llmemory.sizeof(TYPE)
def get_array_token(T, translate_support_code):
    # T can be an array or a var-sized structure
    if translate_support_code:
        basesize = llmemory.sizeof(T, 0)
        if isinstance(T, lltype.Struct):
            SUBARRAY = getattr(T, T._arrayfld)
            itemsize = llmemory.sizeof(SUBARRAY.OF)
                          llmemory.ArrayLengthOffset(SUBARRAY))
        else:
            itemsize = llmemory.sizeof(T.OF)
            ofs_length = llmemory.ArrayLengthOffset(T)
    else:

src/p/l/plexnet-HEAD/third_party/generic/pypy/pypy/rpython/memory/gctypelayout.py   plexnet(Download)
    if not TYPE._is_varsize():
        info.fixedsize = llarena.round_up_for_allocation(
            llmemory.sizeof(TYPE), builder.GCClass.object_minimal_size)
        # note about round_up_for_allocation(): in the 'info' table
        # we put a rounded-up size only for fixed-size objects.  For
        infobits |= T_IS_VARSIZE
        varinfo = lltype.cast_pointer(GCData.VARSIZE_TYPE_INFO_PTR, info)
        info.fixedsize = llmemory.sizeof(TYPE, 0)
        if isinstance(TYPE, lltype.Struct):
            ARRAY = TYPE._flds[TYPE._arrayfld]
            infobits |= T_HAS_GCPTR_IN_VARSIZE
        varinfo.varofstoptrs = builder.offsets2table(offsets, ARRAY.OF)
        varinfo.varitemsize = llmemory.sizeof(ARRAY.OF)
    if TYPE == WEAKREF:
        infobits |= T_IS_WEAKREF
class TypeLayoutBuilder(object):
    can_add_new_types = True
    can_encode_type_shape = True    # set to False initially by the JIT
 
    size_of_fixed_type_info = llmemory.sizeof(GCData.TYPE_INFO)
WEAKREF = lltype.GcStruct("weakref", ("weakptr", llmemory.Address))
WEAKREFPTR = lltype.Ptr(WEAKREF)
sizeof_weakref= llmemory.sizeof(WEAKREF)
empty_weakref = lltype.malloc(WEAKREF, immortal=True)
empty_weakref.weakptr = llmemory.NULL

src/p/l/plexnet-HEAD/third_party/generic/pypy/pypy/rpython/memory/gctransform/transform.py   plexnet(Download)
        meth = getattr(self, 'gct_fv_%s_malloc' % flavor, None)
        assert meth, "%s has no support for malloc with flavor %r" % (self, flavor) 
        c_size = rmodel.inputconst(lltype.Signed, llmemory.sizeof(TYPE))
        v_raw = meth(hop, flags, TYPE, c_size)
        hop.cast_result(v_raw)
        offset_to_length = llmemory.FieldOffset(TYPE, TYPE._arrayfld) + \
                           llmemory.ArrayLengthOffset(ARRAY)
        c_const_size = intconst(llmemory.sizeof(TYPE, 0))
        c_item_size = intconst(llmemory.sizeof(ARRAY.OF))
 
        v_adrnewbuf = hop.genop('adr_add', [v_adrnewbuf, v_ofs],
                                resulttype=llmemory.Address)
        size = llmemory.sizeof(getattr(TYPE, TYPE._arrayfld).OF)
        c_size = rmodel.inputconst(lltype.Signed, size)
        v_lgtsym = hop.genop('int_mul', [c_size, v_lgt],
            ARRAY = TYPE
        assert isinstance(ARRAY, lltype.Array)
        c_const_size = intconst(llmemory.sizeof(TYPE, 0))
        c_item_size = intconst(llmemory.sizeof(ARRAY.OF))
 

src/s/y/Sypy-HEAD/jit/backend/llsupport/symbolic.py   Sypy(Download)
def get_size(TYPE, translate_support_code):
    if translate_support_code:
        if TYPE._is_varsize():
            return llmemory.sizeof(TYPE, 0)
        return llmemory.sizeof(TYPE)
def get_array_token(T, translate_support_code):
    # T can be an array or a var-sized structure
    if translate_support_code:
        basesize = llmemory.sizeof(T, 0)
        if isinstance(T, lltype.Struct):
            SUBARRAY = getattr(T, T._arrayfld)
            itemsize = llmemory.sizeof(SUBARRAY.OF)
            else:
                ofs_length = llmemory.ArrayLengthOffset(T)
            itemsize = llmemory.sizeof(T.OF)
    else:
        if isinstance(T, lltype.Struct):

src/p/l/plexnet-HEAD/third_party/generic/pypy/pypy/rpython/memory/gc/markcompact.py   plexnet(Download)
                addraftercollect += raw_malloc_usage(objtotalsize)
                if copy_has_hash_field:
                    addraftercollect += llmemory.sizeof(lltype.Signed)
            num += 1
            fromaddr += objtotalsize
            if tid & GCFLAG_HASHFIELD:
                fromaddr += llmemory.sizeof(lltype.Signed)
        totalsize = self.new_space_size(size_of_alive_objs, needed +
                                        num_of_alive_objs * BYTES_PER_TID)
        tid_backup_size = (llmemory.sizeof(self.TID_BACKUP, 0) +
                           llmemory.sizeof(TID_TYPE) * num_of_alive_objs)
        used_space_now = self.next_collect_after + raw_malloc_usage(tid_backup_size)
    def get_size_incl_hash(self, obj):
        size = self.get_size(obj)
        hdr = self.header(obj)
        if hdr.tid & GCFLAG_HASHFIELD:
            size += llmemory.sizeof(lltype.Signed)

src/s/y/Sypy-HEAD/rpython/memory/gctypelayout.py   Sypy(Download)
    if not TYPE._is_varsize():
        info.fixedsize = llarena.round_up_for_allocation(
            llmemory.sizeof(TYPE), builder.GCClass.object_minimal_size)
        # note about round_up_for_allocation(): in the 'info' table
        # we put a rounded-up size only for fixed-size objects.  For
        infobits |= T_IS_VARSIZE
        varinfo = lltype.cast_pointer(GCData.VARSIZE_TYPE_INFO_PTR, info)
        info.fixedsize = llmemory.sizeof(TYPE, 0)
        if isinstance(TYPE, lltype.Struct):
            ARRAY = TYPE._flds[TYPE._arrayfld]
            infobits |= T_HAS_GCPTR_IN_VARSIZE
        varinfo.varofstoptrs = builder.offsets2table(offsets, ARRAY.OF)
        varinfo.varitemsize = llmemory.sizeof(ARRAY.OF)
    if builder.is_weakref_type(TYPE):
        infobits |= T_IS_WEAKREF
class TypeLayoutBuilder(object):
    can_add_new_types = True
    can_encode_type_shape = True    # set to False initially by the JIT
 
    size_of_fixed_type_info = llmemory.sizeof(GCData.TYPE_INFO)
WEAKREF = lltype.GcStruct("weakref", ("weakptr", llmemory.Address))
WEAKREFPTR = lltype.Ptr(WEAKREF)
sizeof_weakref= llmemory.sizeof(WEAKREF)
empty_weakref = lltype.malloc(WEAKREF, immortal=True)
empty_weakref.weakptr = llmemory.NULL

src/s/y/Sypy-HEAD/rpython/memory/gc/markcompact.py   Sypy(Download)
        maxnum = self.space_size - (self.free - self.space)
        maxnum /= BYTES_PER_TID
        llarena.arena_reserve(self.free, llmemory.sizeof(TID_BACKUP, maxnum))
        self.tid_backup = llmemory.cast_adr_to_ptr(self.free,
                                                   lltype.Ptr(TID_BACKUP))
            totalsrcsize = basesize
            if hdr.tid & GCFLAG_HASHFIELD:  # already a hash field, copy it too
                totalsrcsize += llmemory.sizeof(lltype.Signed)
            #
            if self.marked(obj):
                    # (otherwise, we get a bogus toaddr > fromaddr)
                    if self.toaddr_smaller_than_fromaddr(toaddr, fromaddr):
                        totaldstsize += llmemory.sizeof(lltype.Signed)
                #
                if not translated_to_c():
                    llarena.arena_reserve(toaddr, basesize)
                    if (raw_malloc_usage(totaldstsize) >
                        raw_malloc_usage(basesize)):
                        llarena.arena_reserve(toaddr + basesize,
                                              llmemory.sizeof(lltype.Signed))
                grow_hash_field = False
                if hdr.tid & GCFLAG_SAVED_HASHFIELD:
                    totalsrcsize += llmemory.sizeof(lltype.Signed)
                totaldstsize = totalsrcsize
                if (hdr.tid & (GCFLAG_SAVED_HASHTAKEN|GCFLAG_SAVED_HASHFIELD)

src/s/y/Sypy-HEAD/rpython/memory/gctransform/transform.py   Sypy(Download)
        meth = getattr(self, 'gct_fv_%s_malloc' % flavor, None)
        assert meth, "%s has no support for malloc with flavor %r" % (self, flavor) 
        c_size = rmodel.inputconst(lltype.Signed, llmemory.sizeof(TYPE))
        v_raw = meth(hop, flags, TYPE, c_size)
        hop.cast_result(v_raw)
            ARRAY = TYPE
        assert isinstance(ARRAY, lltype.Array)
        c_const_size = intconst(llmemory.sizeof(TYPE, 0))
        c_item_size = intconst(llmemory.sizeof(ARRAY.OF))
 

src/s/y/Sypy-HEAD/rpython/memory/gc/semispace.py   Sypy(Download)
    FORWARDSTUBPTR = lltype.Ptr(FORWARDSTUB)
 
    object_minimal_size = llmemory.sizeof(FORWARDSTUB)
 
    # the following values override the default arguments of __init__ when
    def get_size_incl_hash(self, obj):
        size = self.get_size(obj)
        hdr = self.header(obj)
        if (hdr.tid & GCFLAG_HASHMASK) == GC_HASH_HASFIELD:
            size += llmemory.sizeof(lltype.Signed)
            hash = self._get_object_hash(obj, objsize, tid)
            llarena.arena_reserve(newaddr + totalsize,
                                  llmemory.sizeof(lltype.Signed))
            (newaddr + totalsize).signed[0] = hash
            tid |= GC_HASH_HASFIELD
            totalsize += llmemory.sizeof(lltype.Signed)
        # writes after translation to C.
        size_gc_header = self.size_gc_header()
        stubsize = llmemory.sizeof(self.FORWARDSTUB)
        tid = self.header(obj).tid
        ll_assert(tid & GCFLAG_EXTERNAL == 0,  "unexpected GCFLAG_EXTERNAL")

src/p/l/plexnet-HEAD/third_party/generic/pypy/pypy/rpython/memory/gc/semispace.py   plexnet(Download)
    FORWARDSTUBPTR = lltype.Ptr(FORWARDSTUB)
 
    object_minimal_size = llmemory.sizeof(FORWARDSTUB)
 
    # the following values override the default arguments of __init__ when
    def get_size_incl_hash(self, obj):
        size = self.get_size(obj)
        hdr = self.header(obj)
        if hdr.tid & GCFLAG_HASHFIELD:
            size += llmemory.sizeof(lltype.Signed)
                tid |= GCFLAG_HASHFIELD
            (newaddr + totalsize).signed[0] = hash
            totalsize += llmemory.sizeof(lltype.Signed)
        #
        self.free += totalsize
        # writes after translation to C.
        size_gc_header = self.size_gc_header()
        stubsize = llmemory.sizeof(self.FORWARDSTUB)
        tid = self.header(obj).tid
        ll_assert(tid & GCFLAG_EXTERNAL == 0,  "unexpected GCFLAG_EXTERNAL")
                # external object.  Shrink the top of space by the extra
                # hash word that will be needed after a collect.
                shrunk_top = self.top_of_space - llmemory.sizeof(lltype.Signed)
                if shrunk_top < self.free:
                    # Cannot shrink!  Do a collection, asking for at least

  1 | 2 | 3 | 4 | 5  Next