Align doubles to 8 bytes in the StandardMessageCodec (flutter/engine#3779)
See https://github.com/flutter/flutter/issues/10701
This commit is contained in:
committed by
Todd Volkert
parent
b08fe0c47a
commit
156f123b12
@@ -192,6 +192,7 @@ public final class StandardMessageCodec implements MessageCodec<Object> {
|
||||
writeLong(stream, (long) value);
|
||||
} else if (value instanceof Float || value instanceof Double) {
|
||||
stream.write(DOUBLE);
|
||||
writeAlignment(stream, 8);
|
||||
writeDouble(stream, ((Number) value).doubleValue());
|
||||
} else if (value instanceof BigInteger) {
|
||||
stream.write(BIGINT);
|
||||
@@ -305,6 +306,7 @@ public final class StandardMessageCodec implements MessageCodec<Object> {
|
||||
break;
|
||||
}
|
||||
case DOUBLE:
|
||||
readAlignment(buffer, 8);
|
||||
result = buffer.getDouble();
|
||||
break;
|
||||
case STRING: {
|
||||
|
||||
Reference in New Issue
Block a user