Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 415 for SWAP (0.1 sec)

  1. 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)
  2. 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)
  3. src/sort/sort.go

    	// See Float64Slice.Less for a correct implementation for floating-point values.
    	Less(i, j int) bool
    
    	// Swap swaps the elements with indexes i and j.
    	Swap(i, j int)
    }
    
    // Sort sorts data in ascending order as determined by the Less method.
    // It makes one call to data.Len to determine n and O(n*log(n)) calls to
    // data.Less and data.Swap. The sort is not guaranteed to be stable.
    //
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Nov 28 16:40:32 UTC 2023
    - 10.1K bytes
    - Viewed (0)
  4. pkg/kubelet/kuberuntime/kuberuntime_container_linux.go

    		}
    	}
    
    	return lcr
    }
    
    // configureContainerSwapResources configures the swap resources for a specified (linux) container.
    // Swap is only configured if a swap cgroup controller is available and the NodeSwap feature gate is enabled.
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed May 29 22:40:29 UTC 2024
    - 17.2K bytes
    - Viewed (0)
  5. 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)
  6. src/internal/runtime/atomic/types.go

    // and if they're equal, swaps i's value with new.
    // It reports whether the swap ran.
    //
    //go:nosplit
    func (i *Int32) CompareAndSwap(old, new int32) bool {
    	return Casint32(&i.value, old, new)
    }
    
    // Swap replaces i's value with new, returning
    // i's value before the replacement.
    //
    //go:nosplit
    func (i *Int32) Swap(new int32) int32 {
    	return Xchgint32(&i.value, new)
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 19:53:03 UTC 2024
    - 14.2K bytes
    - Viewed (0)
  7. 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)
  8. android/guava-tests/test/com/google/common/math/QuantilesAlgorithm.java

              swap(array, from, to);
            }
            if (array[from + 1] > array[to]) {
              swap(array, from + 1, to);
            }
            if (array[from] > array[from + 1]) {
              swap(array, from, from + 1);
            }
    
            // Perform a partition with the selected median.
            int low = from + 1, high = to; // Indexes for partitioning.
            double partition = array[from + 1]; // Choose partitioning element.
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Tue Feb 01 16:30:37 UTC 2022
    - 7.1K bytes
    - Viewed (0)
  9. src/cmd/compile/internal/test/inl_test.go

    			"(*Uint32).Swap",
    			"(*Uint64).Add",
    			"(*Uint64).CompareAndSwap",
    			"(*Uint64).Load",
    			"(*Uint64).Store",
    			"(*Uint64).Swap",
    			"(*Uintptr).Add",
    			"(*Uintptr).CompareAndSwap",
    			"(*Uintptr).Load",
    			"(*Uintptr).Store",
    			"(*Uintptr).Swap",
    			"(*Pointer[go.shape.int]).CompareAndSwap",
    			"(*Pointer[go.shape.int]).Load",
    			"(*Pointer[go.shape.int]).Store",
    			"(*Pointer[go.shape.int]).Swap",
    		},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 09 04:07:57 UTC 2024
    - 10.7K bytes
    - Viewed (0)
  10. src/sync/atomic/doc.go

    // Share memory by communicating;
    // don't communicate by sharing memory.
    //
    // The swap operation, implemented by the SwapT functions, is the atomic
    // equivalent of:
    //
    //	old = *addr
    //	*addr = new
    //	return old
    //
    // The compare-and-swap operation, implemented by the CompareAndSwapT
    // functions, is the atomic equivalent of:
    //
    //	if *addr == old {
    //		*addr = new
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jun 07 21:14:51 UTC 2024
    - 11.7K bytes
    - Viewed (0)
Back to top