summaryrefslogtreecommitdiff
path: root/dart/lib
diff options
context:
space:
mode:
authorLight Lin <lxrite@gmail.com>2019-12-19 03:23:54 +0800
committerWouter van Oortmerssen <aardappel@gmail.com>2019-12-18 11:23:54 -0800
commitce3a1c43a2882b44b22785c21652a6e7aff60f8b (patch)
tree17898860e82c06719d7e0d1d7c83aa024c8599bc /dart/lib
parentaa75e5734b14d7110a5862e9aec153e6e2e13945 (diff)
downloadflatbuffers-ce3a1c43a2882b44b22785c21652a6e7aff60f8b.tar.gz
flatbuffers-ce3a1c43a2882b44b22785c21652a6e7aff60f8b.tar.bz2
flatbuffers-ce3a1c43a2882b44b22785c21652a6e7aff60f8b.zip
[Dart] Fix prepare space for writeListInt64 and writeListUint64 (#5654)
* Fix prepare space for writeListInt64 and writeListUint64 * Fix align issues
Diffstat (limited to 'dart/lib')
-rw-r--r--dart/lib/flat_buffers.dart6
1 files changed, 3 insertions, 3 deletions
diff --git a/dart/lib/flat_buffers.dart b/dart/lib/flat_buffers.dart
index e2512604..3d4cf81b 100644
--- a/dart/lib/flat_buffers.dart
+++ b/dart/lib/flat_buffers.dart
@@ -492,7 +492,7 @@ class Builder {
/// Write the given list of 64-bit float [values].
int writeListFloat64(List<double> values) {
_ensureNoVTable();
- _prepare(4, 1 + (2 * values.length));
+ _prepare(_sizeofFloat64, values.length, additionalBytes: _sizeofUint32);
final int result = _tail;
int tail = _tail;
_setUint32AtTail(_buf, tail, values.length);
@@ -522,7 +522,7 @@ class Builder {
/// Write the given list of signed 64-bit integer [values].
int writeListInt64(List<int> values) {
_ensureNoVTable();
- _prepare(_sizeofUint32, 2 * values.length);
+ _prepare(_sizeofInt64, values.length, additionalBytes: _sizeofUint32);
final int result = _tail;
int tail = _tail;
_setUint32AtTail(_buf, tail, values.length);
@@ -537,7 +537,7 @@ class Builder {
/// Write the given list of signed 64-bit integer [values].
int writeListUint64(List<int> values) {
_ensureNoVTable();
- _prepare(_sizeofUint32, 2 * values.length);
+ _prepare(_sizeofUint64, values.length, additionalBytes: _sizeofUint32);
final int result = _tail;
int tail = _tail;
_setUint32AtTail(_buf, tail, values.length);