Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 100 for segments (0.15 sec)

  1. android/guava-tests/test/com/google/common/cache/LocalCacheTest.java

        // no entry
        assertEquals(0, segment.count);
        assertNull(segment.remove(key, hash));
        assertEquals(0, segment.count);
    
        // same key
        table.set(index, entry);
        segment.count++;
        assertEquals(1, segment.count);
        assertSame(oldValue, segment.get(key, hash));
        assertSame(oldValue, segment.remove(key, hash));
        assertEquals(0, segment.count);
        assertNull(segment.get(key, hash));
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 19:07:49 UTC 2024
    - 110.6K bytes
    - Viewed (0)
  2. guava-tests/test/com/google/common/cache/LocalCacheTest.java

        // no entry
        assertEquals(0, segment.count);
        assertNull(segment.remove(key, hash));
        assertEquals(0, segment.count);
    
        // same key
        table.set(index, entry);
        segment.count++;
        assertEquals(1, segment.count);
        assertSame(oldValue, segment.get(key, hash));
        assertSame(oldValue, segment.remove(key, hash));
        assertEquals(0, segment.count);
        assertNull(segment.get(key, hash));
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 19:07:49 UTC 2024
    - 112.3K bytes
    - Viewed (0)
  3. guava-tests/test/com/google/common/cache/CacheBuilderTest.java

        LocalCache<?, ?> map = CacheTesting.toLocalCache(cache);
    
        assertThat(map.segments).hasLength(4);
        assertEquals(2, map.segments[0].table.length());
        assertEquals(2, map.segments[1].table.length());
        assertEquals(2, map.segments[2].table.length());
        assertEquals(2, map.segments[3].table.length());
      }
    
      @GwtIncompatible // CacheTesting
      public void testInitialCapacity_smallest() {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 15:00:32 UTC 2024
    - 24.9K bytes
    - Viewed (0)
  4. android/guava-tests/test/com/google/common/collect/MapMakerInternalMapTest.java

        assertSame(oldValue, segment.remove(key, hash));
        assertEquals(0, segment.count);
        assertNull(segment.get(key, hash));
    
        // cleared
        segment.setTableEntryForTesting(index, entry);
        segment.count++;
        assertEquals(1, segment.count);
        assertSame(oldValue, segment.get(key, hash));
        oldValueRef.clear();
        assertNull(segment.remove(key, hash));
        assertEquals(0, segment.count);
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Tue Feb 20 17:00:05 UTC 2024
    - 35.1K bytes
    - Viewed (0)
  5. guava-tests/test/com/google/common/collect/MapMakerInternalMapTest.java

        assertSame(oldValue, segment.remove(key, hash));
        assertEquals(0, segment.count);
        assertNull(segment.get(key, hash));
    
        // cleared
        segment.setTableEntryForTesting(index, entry);
        segment.count++;
        assertEquals(1, segment.count);
        assertSame(oldValue, segment.get(key, hash));
        oldValueRef.clear();
        assertNull(segment.remove(key, hash));
        assertEquals(0, segment.count);
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Tue Feb 20 17:00:05 UTC 2024
    - 35.1K bytes
    - Viewed (0)
  6. guava/src/com/google/common/collect/MapMakerInternalMap.java

         */
        long sum = 0L;
        Segment<K, V, E, S>[] segments = this.segments;
        for (int i = 0; i < segments.length; ++i) {
          if (segments[i].count != 0) {
            return false;
          }
          sum += segments[i].modCount;
        }
    
        if (sum != 0L) { // recheck unless no modifications
          for (int i = 0; i < segments.length; ++i) {
            if (segments[i].count != 0) {
              return false;
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 20:24:49 UTC 2024
    - 90.8K bytes
    - Viewed (0)
  7. guava-tests/benchmark/com/google/common/cache/SegmentBenchmark.java

                CacheBuilder.newBuilder().concurrencyLevel(1).initialCapacity(capacity), null);
        checkState(cache.segments.length == 1);
        segment = cache.segments[0];
        checkState(segment.table.length() == capacity);
        for (int i = 0; i < segment.threshold; i++) {
          cache.put(new Object(), new Object());
        }
        checkState(segment.table.length() == capacity);
      }
    
      @SuppressWarnings("GuardedBy")
      @Benchmark
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Mon Dec 23 16:59:39 UTC 2019
    - 2.1K bytes
    - Viewed (0)
  8. android/guava/src/com/google/common/collect/MapMakerInternalMap.java

         */
        long sum = 0L;
        Segment<K, V, E, S>[] segments = this.segments;
        for (int i = 0; i < segments.length; ++i) {
          if (segments[i].count != 0) {
            return false;
          }
          sum += segments[i].modCount;
        }
    
        if (sum != 0L) { // recheck unless no modifications
          for (int i = 0; i < segments.length; ++i) {
            if (segments[i].count != 0) {
              return false;
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 20:24:49 UTC 2024
    - 90.8K bytes
    - Viewed (0)
  9. okhttp-testing-support/src/main/kotlin/okhttp3/TestUtilJvm.kt

       *
       * Use this method to create a degenerate Okio Buffer where each byte is in a separate segment of
       * the internal list.
       */
      @JvmStatic
      fun fragmentBuffer(buffer: Buffer): Buffer {
        // Write each byte into a new buffer, then clone it so that the segments are shared.
        // Shared segments cannot be compacted so we'll get a long chain of short segments.
        val result = Buffer()
        while (!buffer.exhausted()) {
          val box = Buffer()
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Thu Apr 11 22:09:35 UTC 2024
    - 4.3K bytes
    - Viewed (0)
  10. guava/src/com/google/common/cache/LocalCache.java

          for (Segment<K, V> segment : segments) {
            if (segment.count != 0) {
              return false;
            }
            sum -= segment.modCount;
          }
          return sum == 0L;
        }
        return true;
      }
    
      long longSize() {
        Segment<K, V>[] segments = this.segments;
        long sum = 0;
        for (Segment<K, V> segment : segments) {
          sum += segment.count;
        }
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 19:07:49 UTC 2024
    - 149.2K bytes
    - Viewed (0)
Back to top