Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 121 for relocs (0.19 sec)

  1. src/io/multi_test.go

    	type simpleWriter struct { // hide bytes.Buffer's WriteString
    		Writer
    	}
    	mw := MultiWriter(simpleWriter{&sink1}, simpleWriter{&sink2})
    	allocs := int(testing.AllocsPerRun(1000, func() {
    		WriteString(mw, "foo")
    	}))
    	if allocs != 1 {
    		t.Errorf("num allocations = %d; want 1", allocs)
    	}
    }
    
    type writeStringChecker struct{ called bool }
    
    func (c *writeStringChecker) WriteString(s string) (n int, err error) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 06 15:49:32 UTC 2022
    - 10K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apiserver/pkg/authentication/token/cache/cached_token_authenticator_test.go

    		s := utilrand.String(size)
    		f := func() {
    			b := toBytes(s)
    			if len(b) != size {
    				t.Errorf("invalid length: %d", len(b))
    			}
    		}
    		allocs := testing.AllocsPerRun(100, f)
    		if allocs > 0 {
    			t.Errorf("expected zero allocations, got %v", allocs)
    		}
    	})
    
    	t.Run("toString semantics", func(t *testing.T) {
    		t.Parallel()
    
    		b := make([]byte, size)
    		if _, err := rand.Read(b); err != nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Jul 03 16:16:51 UTC 2023
    - 20.3K bytes
    - Viewed (0)
  3. android/guava-tests/test/com/google/common/math/BigIntegerMathTest.java

            int result = BigIntegerMath.log2(x, mode);
            assertTrue(ZERO.setBit(result).compareTo(x) >= 0);
            assertTrue(result == 0 || ZERO.setBit(result - 1).compareTo(x) < 0);
          }
        }
      }
    
      // Relies on the correctness of isPowerOfTwo(BigInteger).
      public void testLog2Exact() {
        for (BigInteger x : POSITIVE_BIGINTEGER_CANDIDATES) {
          // We only expect an exception if x was not a power of 2.
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Fri May 17 17:58:33 UTC 2024
    - 27.8K bytes
    - Viewed (0)
  4. src/runtime/testdata/testprog/gc.go

    	// Alternate between whether the chunk will be held live or will be
    	// condemned to GC to create holes in the heap.
    	saved := make([][]byte, allocs/2+1)
    	condemned := make([][]byte, allocs/2)
    	for i := 0; i < allocs; i++ {
    		b := make([]byte, allocChunk)
    		if i%2 == 0 {
    			saved = append(saved, b)
    		} else {
    			condemned = append(condemned, b)
    		}
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sun Oct 02 02:28:27 UTC 2022
    - 12.1K bytes
    - Viewed (0)
  5. src/cmd/compile/internal/syntax/parser_test.go

    			t.Errorf("%s: got line = %d; want %d", test.src, line, test.line)
    		}
    		if col := pos.RelCol(); col != test.col {
    			t.Errorf("%s: got col = %d; want %d", test.src, col, test.col)
    		}
    	}
    }
    
    // Test that typical uses of UnpackListExpr don't allocate.
    func TestUnpackListExprAllocs(t *testing.T) {
    	var x Expr = NewName(Pos{}, "x")
    	allocs := testing.AllocsPerRun(1000, func() {
    		list := UnpackListExpr(x)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 14 16:30:19 UTC 2024
    - 12.2K bytes
    - Viewed (0)
  6. android/guava-tests/test/com/google/common/math/LongMathTest.java

            try {
              LongMath.log2(x, mode);
              fail("Expected IllegalArgumentException");
            } catch (IllegalArgumentException expected) {
            }
          }
        }
      }
    
      /* Relies on the correctness of BigIntegerMath.log2 for all modes except UNNECESSARY. */
      public void testLog2MatchesBigInteger() {
        for (long x : POSITIVE_LONG_CANDIDATES) {
          for (RoundingMode mode : ALL_SAFE_ROUNDING_MODES) {
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Mon Mar 04 20:15:57 UTC 2024
    - 32.5K bytes
    - Viewed (0)
  7. guava/src/com/google/common/hash/BloomFilter.java

       * is.
       *
       * <p>It is recommended that the funnel be implemented as a Java enum. This has the benefit of
       * ensuring proper serialization and deserialization, which is important since {@link #equals}
       * also relies on object identity of funnels.
       *
       * @param funnel the funnel of T's that the constructed {@code BloomFilter} will use
       * @param expectedInsertions the number of expected insertions to the constructed {@code
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Mon Apr 01 16:15:01 UTC 2024
    - 26.3K bytes
    - Viewed (0)
  8. src/net/http/pprof/pprof.go

    	}
    	p0.TimeNanos = ts
    	return p0, nil
    }
    
    var profileSupportsDelta = map[handler]bool{
    	"allocs":       true,
    	"block":        true,
    	"goroutine":    true,
    	"heap":         true,
    	"mutex":        true,
    	"threadcreate": true,
    }
    
    var profileDescriptions = map[string]string{
    	"allocs":       "A sampling of all past memory allocations",
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Feb 27 17:34:05 UTC 2024
    - 14.1K bytes
    - Viewed (0)
  9. src/crypto/ed25519/ed25519_test.go

    	}
    	testenv.SkipIfOptimizationOff(t)
    
    	if allocs := testing.AllocsPerRun(100, func() {
    		seed := make([]byte, SeedSize)
    		message := []byte("Hello, world!")
    		priv := NewKeyFromSeed(seed)
    		pub := priv.Public().(PublicKey)
    		signature := Sign(priv, message)
    		if !Verify(pub, message, signature) {
    			t.Fatal("signature didn't verify")
    		}
    	}); allocs > 0 {
    		t.Errorf("expected zero allocations, got %0.1f", allocs)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 27 18:23:49 UTC 2024
    - 10.9K bytes
    - Viewed (0)
  10. src/encoding/binary/binary_test.go

    func TestAppendAllocs(t *testing.T) {
    	buf := make([]byte, 0, Size(&s))
    	var err error
    	allocs := testing.AllocsPerRun(1, func() {
    		_, err = Append(buf, LittleEndian, &s)
    	})
    	if err != nil {
    		t.Fatal("Append failed:", err)
    	}
    	if allocs != 0 {
    		t.Fatalf("Append allocated %v times instead of not allocating at all", allocs)
    	}
    }
    
    var sizableTypes = []any{
    	bool(false),
    	int8(0),
    	int16(0),
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 20 19:16:18 UTC 2024
    - 25.4K bytes
    - Viewed (0)
Back to top