You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The serializedSize() function returns the number of bytes it would take to serialize an object. It returns an integer, unless it is greater than .Machine$integer.max (= ~2.15 GB), in case it returns a double (
This agility of serializedSize() to return an integer, if sufficient, can lead to silent errors downstream. For instance, two objects might be small enough to return an integer;
Background
The
serializedSize()
function returns the number of bytes it would take to serialize an object. It returns an integer, unless it is greater than.Machine$integer.max
(= ~2.15 GB), in case it returns a double (parallelly/src/calc-serialized-size.c
Lines 74 to 78 in 88783a6
Issue
This agility of
serializedSize()
to return an integer, if sufficient, can lead to silent errors downstream. For instance, two objects might be small enough to return an integer;but large enough for their sum to overflow;
This problem was first reported by @ycl6 in futureverse/future#755.
Suggestion
Change
serializedSize()
to always return a double. FWIW, that is whatutils::object.size()
does./cc @coolbutuseless
The text was updated successfully, but these errors were encountered: