aboutsummaryrefslogtreecommitdiff
path: root/src/parseTools.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-07-04 16:08:05 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-07-04 16:08:05 -0700
commitb9e43e29b6c9e251334b1de75dec1d04d2013853 (patch)
tree170578da349f189d92f5b30051e1c40f8c87ac3c /src/parseTools.js
parent370128e8d9459cfe6469a38be8d0282d9d4f92cd (diff)
fix a bug with allocate not being told the right number of bytes with single double values, and fix one extra byte being needlessly allocated while we are at it
Diffstat (limited to 'src/parseTools.js')
-rw-r--r--src/parseTools.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/parseTools.js b/src/parseTools.js
index e13d8807..4f2f7142 100644
--- a/src/parseTools.js
+++ b/src/parseTools.js
@@ -775,7 +775,7 @@ function generateStructTypes(type) {
if (USE_TYPED_ARRAYS == 2 && type == 'i64') {
return ['i64', 0, 0, 0, 'i32', 0, 0, 0];
}
- return [type].concat(zeros(Runtime.getNativeFieldSize(type)));
+ return [type].concat(zeros(Runtime.getNativeFieldSize(type)-1));
}
// Avoid multiple concats by finding the size first. This is much faster
@@ -1264,7 +1264,7 @@ function makePointer(slab, pos, allocator, type) {
var evaled = typeof slab === 'string' ? eval(slab) : slab;
de = dedup(evaled);
if (de.length === 1 && de[0] === 0) {
- slab = evaled.length;
+ slab = types.length;
}
// TODO: if not all zeros, at least filter out items with type === 0. requires cleverness to know how to skip at runtime though. also
// be careful of structure padding