Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 136 for SWAP (0.08 sec)

  1. src/sync/atomic/type.go

    // Store atomically stores val into x.
    func (x *Bool) Store(val bool) { StoreUint32(&x.v, b32(val)) }
    
    // Swap atomically stores new into x and returns the previous value.
    func (x *Bool) Swap(new bool) (old bool) { return SwapUint32(&x.v, b32(new)) != 0 }
    
    // CompareAndSwap executes the compare-and-swap operation for the boolean value x.
    func (x *Bool) CompareAndSwap(old, new bool) (swapped bool) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 17 18:37:29 UTC 2024
    - 8.5K bytes
    - Viewed (0)
  2. src/crypto/ecdh/x25519.go

    	e[31] |= 64
    
    	var x1, x2, z2, x3, z3, tmp0, tmp1 field.Element
    	x1.SetBytes(point[:])
    	x2.One()
    	x3.Set(&x1)
    	z3.One()
    
    	swap := 0
    	for pos := 254; pos >= 0; pos-- {
    		b := e[pos/8] >> uint(pos&7)
    		b &= 1
    		swap ^= int(b)
    		x2.Swap(&x3, swap)
    		z2.Swap(&z3, swap)
    		swap = int(b)
    
    		tmp0.Subtract(&x3, &z3)
    		tmp1.Subtract(&x2, &z2)
    		x2.Add(&x2, &z2)
    		z2.Add(&x3, &z3)
    		z3.Multiply(&tmp0, &x2)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Oct 13 17:09:47 UTC 2023
    - 3.1K bytes
    - Viewed (0)
  3. test/fixedbugs/bug064.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package main
    
    func
    swap(x, y int) (u, v int) {
    	return y, x
    }
    
    func
    main() {
    	a := 1;
    	b := 2;
    	a, b = swap(swap(a, b));
    	if a != 2 || b != 1 {
    		panic("bad swap");
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Feb 18 21:15:42 UTC 2012
    - 342 bytes
    - Viewed (0)
  4. pkg/kubelet/metrics/collectors/resource_metrics.go

    	if s.Swap == nil || s.Swap.SwapUsageBytes == nil {
    		return
    	}
    
    	ch <- metrics.NewLazyMetricWithTimestamp(s.Swap.Time.Time,
    		metrics.NewLazyConstMetric(containerSwapUsageDesc, metrics.GaugeValue,
    			float64(*s.Swap.SwapUsageBytes), s.Name, pod.PodRef.Name, pod.PodRef.Namespace))
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Sep 08 07:13:37 UTC 2023
    - 9.2K bytes
    - Viewed (2)
  5. pkg/kubelet/util/swap/swap_util.go

    func isSwapOnAccordingToProcSwaps(procSwapsContent []byte) bool {
    	procSwapsContent = bytes.TrimSpace(procSwapsContent) // extra trailing \n
    	procSwapsStr := string(procSwapsContent)
    	procSwapsLines := strings.Split(procSwapsStr, "\n")
    
    	// If there is more than one line (table headers) in /proc/swaps then swap is enabled
    	klog.InfoS("Swap is on", "/proc/swaps contents", procSwapsStr)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon May 27 10:07:06 UTC 2024
    - 4.2K bytes
    - Viewed (0)
  6. test/simassign.go

    			printit()
    			panic("fail")
    		}
    	}
    
    	if !testit(false) {
    		print("final val\n")
    		printit()
    		panic("fail")
    	}
    
    	a, b = swap(1, 2)
    	if a != 2 || b != 1 {
    		panic("bad swap")
    	}
    
    	a, b = swap(swap(a, b))
    	if a != 2 || b != 1 {
    		panic("bad swap")
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Feb 24 00:48:19 UTC 2012
    - 1.1K bytes
    - Viewed (0)
  7. src/sync/atomic/value.go

    		return
    	}
    }
    
    // Swap stores new into Value and returns the previous value. It returns nil if
    // the Value is empty.
    //
    // All calls to Swap for a given Value must use values of the same concrete
    // type. Swap of an inconsistent type panics, as does Swap(nil).
    func (v *Value) Swap(new any) (old any) {
    	if new == nil {
    		panic("sync/atomic: swap of nil value into Value")
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Feb 26 20:48:55 UTC 2024
    - 5.9K bytes
    - Viewed (0)
  8. test/fixedbugs/issue5515.go

            b[0] = 0xdeadbeef
            rs := Slice(b)
            sort(rs)
    }
    
    type Slice []T
    
    func (s Slice) Swap(i, j int) {
            tmp := s[i]
            s[i] = s[j]
            s[j] = tmp
    }
    
    type Interface interface {
            Swap(i, j int)
    }
    
    func sort(data Interface) {
            data.Swap(0, 4)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jun 12 03:23:21 UTC 2013
    - 597 bytes
    - Viewed (0)
  9. src/sort/slice.go

    // ergonomic and runs faster.
    func Slice(x any, less func(i, j int) bool) {
    	rv := reflectlite.ValueOf(x)
    	swap := reflectlite.Swapper(x)
    	length := rv.Len()
    	limit := bits.Len(uint(length))
    	pdqsort_func(lessSwap{less, swap}, 0, length, limit)
    }
    
    // SliceStable sorts the slice x using the provided less
    // function, keeping equal elements in their original order.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Nov 28 16:40:32 UTC 2023
    - 1.8K bytes
    - Viewed (0)
  10. src/reflect/example_test.go

    		// Make a function of the right type.
    		v := reflect.MakeFunc(fn.Type(), swap)
    
    		// Assign it to the value fn represents.
    		fn.Set(v)
    	}
    
    	// Make and call a swap function for ints.
    	var intSwap func(int, int) (int, int)
    	makeSwap(&intSwap)
    	fmt.Println(intSwap(0, 1))
    
    	// Make and call a swap function for float64s.
    	var floatSwap func(float64, float64) (float64, float64)
    	makeSwap(&floatSwap)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 19 20:04:36 UTC 2022
    - 4.5K bytes
    - Viewed (0)
Back to top