Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for arithSub (0.07 sec)

  1. test/escape_unsafe.go

    // (3) Conversion of a Pointer to a uintptr and back, with arithmetic.
    
    func arithAdd() unsafe.Pointer {
    	var x [2]byte // ERROR "moved to heap: x"
    	return unsafe.Pointer(uintptr(unsafe.Pointer(&x[0])) + 1)
    }
    
    func arithSub() unsafe.Pointer {
    	var x [2]byte // ERROR "moved to heap: x"
    	return unsafe.Pointer(uintptr(unsafe.Pointer(&x[1])) - 1)
    }
    
    func arithMask() unsafe.Pointer {
    	var x [2]byte // ERROR "moved to heap: x"
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Sep 07 17:25:59 UTC 2022
    - 2.2K bytes
    - Viewed (0)
Back to top