HashConsed

scalus.utils.HashConsed
object HashConsed

Objects are hash-consed during restoring from file. Note, that identityHashCode can be different on the different VM-s, so it is not safe to reky on it. value-based hash-code now is not determenistics on recuresive data structures with self-references. So, we use identityHashCode on VN which store file and restore internal references on other VN.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
HashConsed.type

Members list

Type members

Classlikes

class CachedTaggedRef[A <: AnyRef](val tag: Tag, val ref: HashConsedRef[A]) extends HashConsedRef[A]

Attributes

Supertypes
trait HashConsedRef[A]
class Object
trait Matchable
class Any
case class ConstRef[A <: AnyRef](value: A) extends HashConsedRef[A]

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
trait HashConsedRef[A]
class Object
trait Matchable
class Any
Show all
object ConstRef

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
ConstRef.type
class ForwardRef[A <: AnyRef](val ihc: Int, val tag: Tag) extends HashConsedRef[A]

Attributes

Companion
object
Supertypes
trait HashConsedRef[A]
class Object
trait Matchable
class Any
object ForwardRef

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
ForwardRef.type
class ForwardRefAcceptor(val ihc: Int, val tag: Tag, var setRefActions: List[(HashConsedRef[_]) => Unit])

Attributes

Supertypes
class Object
trait Matchable
class Any
class ForwardValueAcceptor(var setValueActions: List[AnyRef => Unit])

Attributes

Supertypes
class Object
trait Matchable
class Any
class MutRef[A <: AnyRef](var value: A | Null) extends HashConsedRef[A]

Attributes

Companion
object
Supertypes
trait HashConsedRef[A]
class Object
trait Matchable
class Any
object MutRef

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
MutRef.type
case class State(forwardRefAcceptors: Map[(Int, Int), ForwardRefAcceptor], refs: Map[(Int, Int), CachedTaggedRef[_]], forwardValueAcceptors: Map[(Int, Int), ForwardValueAcceptor])

Value parameters

forwardRefAcceptors

- set of forward references, which are not yet resolved from hashConded

forwardValueAcceptors

- set of callbacks, which should be called after the value is readed.

refs

- set of references

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object State

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
State.type

Types

opaque type Tag

Value members

Concrete methods

def finishCallbacks(s: State, debug: Boolean): Unit
def lookup(s: State, ihc: Int, tag: Tag): Option[Either[ForwardRefAcceptor, HashConsedRef[_]]]
def lookupValue(s: State, ihc: Int, tag: Tag): Option[HashConsedRef[_]]
def putForwadValueAcceptor[A <: AnyRef](state: State, ihc: Int, tag: Tag, acceptor: A => Unit): Unit
def setRef[A <: AnyRef](state: State, ihc: Int, tag: Tag, ra: HashConsedRef[A]): Unit
def tag(value: Int): Tag