Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 24 for awaitClear (0.22 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 Apr 26 12:43:10 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 Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 7.4K bytes
    - Viewed (0)
  6. 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)
  7. guava-tests/test/com/google/common/base/FinalizableReferenceQueueClassLoaderUnloadingTest.java

        assertNotNull(sepStopwatchA.get());
        // Clear all references to the Stopwatch and wait for it to be gc'd.
        sepStopwatchA.set(null);
        GcFinalization.awaitClear(sepStopwatchRef.get());
        // Return a weak reference to the parallel ClassLoader. This is the reference that should
        // eventually become clear if there are no other references to the ClassLoader.
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Tue Feb 16 03:24:50 GMT 2021
    - 13.3K bytes
    - Viewed (0)
  8. 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 Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Feb 09 22:57:07 GMT 2022
    - 8.4K bytes
    - Viewed (0)
  9. android/guava-tests/test/com/google/common/base/FinalizableReferenceQueueClassLoaderUnloadingTest.java

        assertNotNull(sepStopwatchA.get());
        // Clear all references to the Stopwatch and wait for it to be gc'd.
        sepStopwatchA.set(null);
        GcFinalization.awaitClear(sepStopwatchRef.get());
        // Return a weak reference to the parallel ClassLoader. This is the reference that should
        // eventually become clear if there are no other references to the ClassLoader.
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Feb 16 03:24:50 GMT 2021
    - 13.3K bytes
    - Viewed (0)
  10. 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 Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 4K bytes
    - Viewed (0)
Back to top