Hints to the pickle format that we KNOW the type of this field, so it can elide any type hints from the final pickle.
Hints to the pickle format that we KNOW the type of this field, so it can elide any type hints from the final pickle. During unpickling, this informs the format that it shouldn't look for any type hints in the pickle, but instead use this tag as the unpickle tag key.
Hints at the expected (byte) size of the entry we're about to write..
Hints the object id of the next beginEntry
/endEntry
calls.
Hints the object id of the next beginEntry
/endEntry
calls.
If this oid is -1, it implies that the next entry has not been registered in any sharing cache, and should
be pickled fully. If the oid != -1, then the pickle format is free to elide the fields of the entry in
favor of pickling a scala.pickling.refs.Ref.
Hint: This is only used during pickling.
Locks the hints down to what we've specified, so if you drop into another pickler it retains our information.
Pops to the previously saved set of hints.
Creates a new fresh set of hints, preserving what was hinted before.
Unlocks the hints.
Hintable defines the interface used between picklers and formats to "aide' in creating clean/efficient formats.
The FULL features picklers allow: - eliding statically known types - structural sharing of data - possible binary size optimizations (using jvm sizes)
Obviously not all picklers will use these mechanisms.
Size Optimization
If a pickler/unpickler calls
hintKnownSize
, it's talking about a binary size of the following entry. ----Type Optimization
If a pickler/unpickler call
hintElidedType
, it's allowing the underlying format to 'drop' the forced storage of a type tag. ----Structural Sharing
If a pickler/unpickler calls
hintOid
, it's telling the underlying format that this particular pickler entry shares it structure with the same entry of that number.Currently, rather than using known tags, picklers assume a per-pickle ordinal associated with each entry. This ordinal should be automatically tracked and restored.