Enum

enum CleanupPolicy

public enum CleanupPolicy <: Equatable<CleanupPolicy> {
    | EAGER
    | DEFERRED
}

Description: Specifies different weak reference reclamation policies, including EAGER and DEFERRED.

The reclamation policy for an object can be specified in the WeakRef class.

EAGER

EAGER

Description: Specifies EAGER as the reclamation policy for a WeakRef instance. Under this reclamation policy, the GC will reclaim the object referenced by WeakRef as soon as possible, but there is no guarantee that it will be reclaimed immediately or necessarily.

DEFERRED

DEFERRED

Description: Specifies DEFERRED as the reclamation policy for a WeakRef instance. Under this reclamation policy, the GC ensures the survival of the object referenced by WeakRef as much as possible. The object will be reclaimed only when the available memory is insufficient.

operator func ==(CleanupPolicy)

public operator func ==(that: CleanupPolicy): Bool

Description: Checks whether the current reclamation policy is the same as Enum CleanupPolicy.

Parameters:

Returns:

  • Bool: If the current reclamation policy is the same as the value of that, true is returned; otherwise, false is returned.

operator func !=(CleanupPolicy)

public operator func !=(that: CleanupPolicy): Bool

Description: Checks whether the current reclamation policy is different from Enum CleanupPolicy.

Parameters:

  • CleanupPolicy: CleanupPolicy: enum instance to be compared with

Returns:

  • Bool: If the current reclamation policy is different from the value of that, true is returned; otherwise, false is returned.