Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for MustGarbageCollect (0.31 sec)

  1. tests/util/leak/check.go

    		if err := check(nil); err != nil {
    			log.Errorf("fatal: %v", err)
    			exitCode = 1
    		}
    	}
    
    	os.Exit(exitCode)
    }
    
    // MustGarbageCollect asserts that an object was garbage collected by the end of the test.
    // The input must be a pointer to an object.
    func MustGarbageCollect(tb test.Failer, i any) {
    	tb.Helper()
    	collected := atomic.NewBool(false)
    	runtime.SetFinalizer(i, func(x any) {
    		collected.Store(true)
    	})
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed Dec 20 10:22:38 UTC 2023
    - 6.9K bytes
    - Viewed (0)
Back to top