PrivateInterner

class PrivateInterner<T>(val verifier: IternabilityVerifier<T> = AlwaysInternableVerifier())

This class converts instances supplied to intern to a common instance within the JVM, amongst all those instances that have been submitted. It uses weak references to avoid memory leaks.

NOTE: the Guava interners are Beta, so upgrading Guava may result in us having to adapt this code.

System properties allow disabling, in the event an issue is uncovered in a live environment. The correct default for the concurrency setting is the result of performance evaluation.

Constructors

Link copied to clipboard
constructor(verifier: IternabilityVerifier<T> = AlwaysInternableVerifier())

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Functions

Link copied to clipboard
fun <S : T> intern(sample: S): S