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 Objecttrait Matchableclass Any
- Self type
-
HashConsed.type
Members list
Type members
Classlikes
Attributes
- Supertypes
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait HashConsedRef[A]class Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- object
- Supertypes
Attributes
- Companion
- class
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
ForwardRef.type
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
Key assigned to an object during encoding. The tag is remembered to detect an attempt to encode the same object under two different tag namespaces, which would leave the second namespace without an encoded body.
Key assigned to an object during encoding. The tag is remembered to detect an attempt to encode the same object under two different tag namespaces, which would leave the second namespace without an encoded body.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
Attributes
- Companion
- object
- Supertypes
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 Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Types
Value members
Concrete methods
Allocate the wire key for a on the encoder side.
Allocate the wire key for a on the encoder side.
The key written to the stream is an opaque identifier: the decoder only uses it to match references, so the encoder is free to choose any value. a.hashCode is only the starting point; if the slot is occupied by a structurally different object (a 32-bit hash collision, routine for recursive types whose hash passes through TypeProxy.identityHashCode), we probe successive keys until we find a free slot or an equal object. Without this, a collision would silently encode the second object as a reference to the first.
Deterministic given the traversal order, so the bitSize and encode passes (each starting from an empty State) assign identical keys.