Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
69653128
Commit
69653128
authored
Jun 16, 2017
by
Jason Simmons
Committed by
GitHub
Jun 16, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Align doubles to 8 bytes in the StandardMessageCodec (#10758)
See
https://github.com/flutter/flutter/issues/10701
parent
3db402ec
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
1 deletion
+11
-1
engine.version
bin/internal/engine.version
+1
-1
serialization.dart
packages/flutter/lib/src/foundation/serialization.dart
+2
-0
message_codecs_test.dart
packages/flutter/test/services/message_codecs_test.dart
+8
-0
No files found.
bin/internal/engine.version
View file @
69653128
f741647d4977410ff8e2c02160eaa02bcb1f0a2b
784e9756720f7f6daa15c95ba3df6215bb54783f
packages/flutter/lib/src/foundation/serialization.dart
View file @
69653128
...
@@ -55,6 +55,7 @@ class WriteBuffer {
...
@@ -55,6 +55,7 @@ class WriteBuffer {
/// Write an Float64 into the buffer.
/// Write an Float64 into the buffer.
void
putFloat64
(
double
value
)
{
void
putFloat64
(
double
value
)
{
_alignTo
(
8
);
_eightBytes
.
setFloat64
(
0
,
value
,
Endianness
.
HOST_ENDIAN
);
_eightBytes
.
setFloat64
(
0
,
value
,
Endianness
.
HOST_ENDIAN
);
_buffer
.
addAll
(
_eightBytesAsList
);
_buffer
.
addAll
(
_eightBytesAsList
);
}
}
...
@@ -150,6 +151,7 @@ class ReadBuffer {
...
@@ -150,6 +151,7 @@ class ReadBuffer {
/// Reads a Float64 from the buffer.
/// Reads a Float64 from the buffer.
double
getFloat64
()
{
double
getFloat64
()
{
_alignTo
(
8
);
final
double
value
=
data
.
getFloat64
(
_position
,
Endianness
.
HOST_ENDIAN
);
final
double
value
=
data
.
getFloat64
(
_position
,
Endianness
.
HOST_ENDIAN
);
_position
+=
8
;
_position
+=
8
;
return
value
;
return
value
;
...
...
packages/flutter/test/services/message_codecs_test.dart
View file @
69653128
...
@@ -177,6 +177,14 @@ void main() {
...
@@ -177,6 +177,14 @@ void main() {
];
];
_checkEncodeDecode
<
dynamic
>(
standard
,
message
);
_checkEncodeDecode
<
dynamic
>(
standard
,
message
);
});
});
test
(
'should align doubles to 8 bytes'
,
()
{
_checkEncoding
<
dynamic
>(
standard
,
1.0
,
<
int
>[
6
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0xf0
,
0x3f
],
);
});
});
});
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment