Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 22 for awaitClear (0.26 sec)

  1. guava-testlib/src/com/google/common/testing/GcFinalization.java

     *   WeakReference<Foo> weakRef = new WeakReference<>(x);
     *   // ... use x ...
     *   x = null;  // Hint to the JIT that x is stack-unreachable
     *   return weakRef;
     * }
     * public void testFooLeak() {
     *   GcFinalization.awaitClear(fooWeakRef());
     * }
     * }</pre>
     *
     * <p>This class cannot currently be used to test soft references, since this class does not try to
     * create the memory pressure required to cause soft references to be cleared.
     *
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Thu Feb 22 17:40:56 GMT 2024
    - 11.6K bytes
    - Viewed (0)
  2. guava-tests/test/com/google/common/util/concurrent/StripedTest.java

      public void testWeakImplementations() {
        for (Striped<?> striped : weakImplementations()) {
          WeakReference<Object> weakRef = new WeakReference<>(striped.get(new Object()));
          GcFinalization.awaitClear(weakRef);
        }
      }
    
      @AndroidIncompatible // Presumably GC doesn't trigger, despite our efforts.
      public void testWeakReadWrite() {
        Striped<ReadWriteLock> striped = Striped.lazyWeakReadWriteLock(1000);
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Feb 09 22:57:07 GMT 2022
    - 8.4K bytes
    - Viewed (0)
  3. android/guava-testlib/src/com/google/common/testing/GcFinalization.java

     *   WeakReference<Foo> weakRef = new WeakReference<>(x);
     *   // ... use x ...
     *   x = null;  // Hint to the JIT that x is stack-unreachable
     *   return weakRef;
     * }
     * public void testFooLeak() {
     *   GcFinalization.awaitClear(fooWeakRef());
     * }
     * }</pre>
     *
     * <p>This class cannot currently be used to test soft references, since this class does not try to
     * create the memory pressure required to cause soft references to be cleared.
     *
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Thu Feb 22 17:40:56 GMT 2024
    - 11.6K bytes
    - Viewed (0)
  4. guava-testlib/test/com/google/common/testing/GcFinalizationTest.java

        assertTrue(future.isDone());
        assertTrue(future.isCancelled());
      }
    
      public void testAwaitClear() {
        final WeakReference<Object> ref = new WeakReference<>(new Object());
        GcFinalization.awaitClear(ref);
        assertNull(ref.get());
      }
    
      public void testAwaitDone_FinalizationPredicate() {
        final WeakHashMap<Object, Object> map = new WeakHashMap<>();
        map.put(new Object(), Boolean.TRUE);
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 7.4K bytes
    - Viewed (0)
  5. android/guava-testlib/test/com/google/common/testing/GcFinalizationTest.java

        assertTrue(future.isDone());
        assertTrue(future.isCancelled());
      }
    
      public void testAwaitClear() {
        final WeakReference<Object> ref = new WeakReference<>(new Object());
        GcFinalization.awaitClear(ref);
        assertNull(ref.get());
      }
    
      public void testAwaitDone_FinalizationPredicate() {
        final WeakHashMap<Object, Object> map = new WeakHashMap<>();
        map.put(new Object(), Boolean.TRUE);
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 7.4K bytes
    - Viewed (0)
  6. android/guava-tests/test/com/google/common/util/concurrent/StripedTest.java

      public void testWeakImplementations() {
        for (Striped<?> striped : weakImplementations()) {
          WeakReference<Object> weakRef = new WeakReference<>(striped.get(new Object()));
          GcFinalization.awaitClear(weakRef);
        }
      }
    
      @AndroidIncompatible // Presumably GC doesn't trigger, despite our efforts.
      public void testWeakReadWrite() {
        Striped<ReadWriteLock> striped = Striped.lazyWeakReadWriteLock(1000);
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Feb 09 22:57:07 GMT 2022
    - 8.4K bytes
    - Viewed (0)
  7. guava-tests/test/com/google/common/base/EnumsTest.java

      public void testGetIfPresent_doesNotPreventClassUnloading() throws Exception {
        WeakReference<?> shadowLoaderReference = doTestClassUnloading();
        GcFinalization.awaitClear(shadowLoaderReference);
      }
    
      // Create a second ClassLoader and use it to get a second version of the TestEnum class.
      // Run Enums.getIfPresent on that other TestEnum and then return a WeakReference containing the
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Tue Oct 03 20:10:02 GMT 2023
    - 8.8K bytes
    - Viewed (0)
  8. android/guava-tests/test/com/google/common/collect/InternersTest.java

        assertSame(canonical, pool.intern(canonical));
    
        WeakReference<Integer> signal = new WeakReference<>(canonical);
        canonical = null; // Hint to the JIT that canonical is unreachable
    
        GcFinalization.awaitClear(signal);
        assertSame(not, pool.intern(not));
      }
    
      public void testAsFunction_simplistic() {
        String canonical = "a";
        String not = new String("a");
    
        Function<String, String> internerFunction =
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 4K bytes
    - Viewed (0)
  9. guava-tests/test/com/google/common/collect/InternersTest.java

        assertSame(canonical, pool.intern(canonical));
    
        WeakReference<Integer> signal = new WeakReference<>(canonical);
        canonical = null; // Hint to the JIT that canonical is unreachable
    
        GcFinalization.awaitClear(signal);
        assertSame(not, pool.intern(not));
      }
    
      public void testAsFunction_simplistic() {
        String canonical = "a";
        String not = new String("a");
    
        Function<String, String> internerFunction =
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 4K bytes
    - Viewed (0)
  10. guava-tests/test/com/google/common/base/FinalizableReferenceQueueTest.java

       */
      private WeakReference<ReferenceQueue<Object>> queueReference;
    
    
      public void testThatFinalizerStops() {
        weaklyReferenceQueue();
        GcFinalization.awaitClear(queueReference);
      }
    
      /** If we don't keep a strong reference to the reference object, it won't be enqueued. */
      @Nullable FinalizableWeakReference<Object> reference;
    
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Tue Oct 10 08:40:05 GMT 2023
    - 4.8K bytes
    - Viewed (0)
Back to top