Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 17 for readVarint (0.2 sec)

  1. src/internal/reflectlite/type.go

    		}
    	}
    }
    
    func (n name) name() string {
    	if n.bytes == nil {
    		return ""
    	}
    	i, l := n.readVarint(1)
    	return unsafe.String(n.data(1+i, "non-empty string"), l)
    }
    
    func (n name) tag() string {
    	if !n.hasTag() {
    		return ""
    	}
    	i, l := n.readVarint(1)
    	i2, l2 := n.readVarint(1 + i + l)
    	return unsafe.String(n.data(1+i+l+i2, "non-empty string"), l2)
    }
    
    func pkgPath(n abi.Name) string {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 07 17:01:54 UTC 2024
    - 16.2K bytes
    - Viewed (0)
  2. src/encoding/binary/varint.go

    		s += 7
    	}
    	return x, errOverflow
    }
    
    // ReadVarint reads an encoded signed integer from r and returns it as an int64.
    // The error is [io.EOF] only if no bytes were read.
    // If an [io.EOF] happens after reading some but not all the bytes,
    // ReadVarint returns [io.ErrUnexpectedEOF].
    func ReadVarint(r io.ByteReader) (int64, error) {
    	ux, err := ReadUvarint(r) // ok to continue in presence of error
    	x := int64(ux >> 1)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 08 19:04:28 UTC 2023
    - 4.8K bytes
    - Viewed (0)
  3. src/cmd/internal/objfile/goobj.go

    	uvdelta := readvarint(p)
    	if uvdelta == 0 && !first {
    		return false
    	}
    	if uvdelta&1 != 0 {
    		uvdelta = ^(uvdelta >> 1)
    	} else {
    		uvdelta >>= 1
    	}
    	vdelta := int32(uvdelta)
    	pcdelta := readvarint(p) * uint32(arch.MinLC)
    	*pc += uint64(pcdelta)
    	*val += vdelta
    	return true
    }
    
    // readvarint reads, removes, and returns a varint from *p.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Aug 15 15:39:57 UTC 2023
    - 7.8K bytes
    - Viewed (0)
  4. src/internal/abi/type.go

    func (n Name) Name() string {
    	if n.Bytes == nil {
    		return ""
    	}
    	i, l := n.ReadVarint(1)
    	return unsafe.String(n.DataChecked(1+i, "non-empty string"), l)
    }
    
    // Tag returns the tag string for n, or empty if there is none.
    func (n Name) Tag() string {
    	if !n.HasTag() {
    		return ""
    	}
    	i, l := n.ReadVarint(1)
    	i2, l2 := n.ReadVarint(1 + i + l)
    	return unsafe.String(n.DataChecked(1+i+l+i2, "non-empty string"), l2)
    }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 17 21:09:59 UTC 2024
    - 21.8K bytes
    - Viewed (0)
  5. src/debug/gosym/pclntab.go

    		return funcData{}
    	}
    	idx := sort.Search(int(t.nfunctab), func(i int) bool {
    		return ft.pc(i) > pc
    	})
    	idx--
    	return t.funcData(uint32(idx))
    }
    
    // readvarint reads, removes, and returns a varint from *pp.
    func (t *LineTable) readvarint(pp *[]byte) uint32 {
    	var v, shift uint32
    	p := *pp
    	for shift = 0; ; shift += 7 {
    		b := p[0]
    		p = p[1:]
    		v |= (uint32(b) & 0x7F) << shift
    		if b&0x80 == 0 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jan 25 19:43:24 UTC 2024
    - 18.8K bytes
    - Viewed (0)
  6. src/go/internal/gcimporter/iimport.go

    	return r.uint64() != 0
    }
    
    func (r *importReader) int64() int64 {
    	n, err := binary.ReadVarint(&r.declReader)
    	if err != nil {
    		errorf("readVarint: %v", err)
    	}
    	return n
    }
    
    func (r *importReader) uint64() uint64 {
    	n, err := binary.ReadUvarint(&r.declReader)
    	if err != nil {
    		errorf("readUvarint: %v", err)
    	}
    	return n
    }
    
    func (r *importReader) byte() byte {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 19.2K bytes
    - Viewed (0)
  7. src/runtime/symtab.go

    	uvdelta := uint32(p[0])
    	if uvdelta == 0 && !first {
    		return nil, false
    	}
    	n := uint32(1)
    	if uvdelta&0x80 != 0 {
    		n, uvdelta = readvarint(p)
    	}
    	*val += int32(-(uvdelta & 1) ^ (uvdelta >> 1))
    	p = p[n:]
    
    	pcdelta := uint32(p[0])
    	n = 1
    	if pcdelta&0x80 != 0 {
    		n, pcdelta = readvarint(p)
    	}
    	p = p[n:]
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 17:58:53 UTC 2024
    - 40K bytes
    - Viewed (0)
  8. src/runtime/type.go

    type name = abi.Name
    
    type structtype = abi.StructType
    
    func pkgPath(n name) string {
    	if n.Bytes == nil || *n.Data(0)&(1<<2) == 0 {
    		return ""
    	}
    	i, l := n.ReadVarint(1)
    	off := 1 + i + l
    	if *n.Data(0)&(1<<1) != 0 {
    		i2, l2 := n.ReadVarint(off)
    		off += i2 + l2
    	}
    	var nameOff nameOff
    	copy((*[4]byte)(unsafe.Pointer(&nameOff))[:], (*[4]byte)(unsafe.Pointer(n.Data(off)))[:])
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:17:26 UTC 2024
    - 12.7K bytes
    - Viewed (0)
  9. src/runtime/panic.go

    	print("\n")
    }
    
    // readvarintUnsafe reads the uint32 in varint format starting at fd, and returns the
    // uint32 and a pointer to the byte following the varint.
    //
    // The implementation is the same with runtime.readvarint, except that this function
    // uses unsafe.Pointer for speed.
    func readvarintUnsafe(fd unsafe.Pointer) (uint32, unsafe.Pointer) {
    	var r uint32
    	var shift int
    	for {
    		b := *(*uint8)(fd)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 17:58:53 UTC 2024
    - 43.8K bytes
    - Viewed (0)
  10. src/reflect/type.go

    	abi.StructType
    }
    
    func pkgPath(n abi.Name) string {
    	if n.Bytes == nil || *n.DataChecked(0, "name flag field")&(1<<2) == 0 {
    		return ""
    	}
    	i, l := n.ReadVarint(1)
    	off := 1 + i + l
    	if n.HasTag() {
    		i2, l2 := n.ReadVarint(off)
    		off += i2 + l2
    	}
    	var nameOff int32
    	// Note that this field may not be aligned in memory,
    	// so we cannot use a direct int32 assignment here.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 17:58:53 UTC 2024
    - 85.5K bytes
    - Viewed (0)
Back to top