aboutsummaryrefslogtreecommitdiff
path: root/src/parseTools.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-09-11 14:58:32 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-09-11 14:58:32 -0700
commit91ae9b1233ba658bcbd4d8b59e8dc30e69548012 (patch)
treea0f4b39fcca3ec4342fb11935b7188c2de0fb163 /src/parseTools.js
parent2c815155ae7f8bf5e5022e58c42d61720df37894 (diff)
compress type info of zeroinitializers in ta2
Diffstat (limited to 'src/parseTools.js')
-rw-r--r--src/parseTools.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/parseTools.js b/src/parseTools.js
index e37f3a99..80ba269b 100644
--- a/src/parseTools.js
+++ b/src/parseTools.js
@@ -1265,6 +1265,9 @@ function makePointer(slab, pos, allocator, type) {
de = dedup(evaled);
if (de.length === 1 && de[0] === 0) {
slab = types.length;
+ if (USE_TYPED_ARRAYS == 2) {
+ types = ['i8']; // if data is zeros, we don't need type info
+ }
}
// 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