aboutsummaryrefslogtreecommitdiff
path: root/src/analyzer.js
diff options
context:
space:
mode:
authoralon@honor <none@none>2010-10-18 21:15:36 -0700
committeralon@honor <none@none>2010-10-18 21:15:36 -0700
commit890130e93bc1128d7b5fbdcc512e243ef78cd712 (patch)
tree161ed3d2fd17a4858e82d1c751861598a95c474a /src/analyzer.js
parentbaa2806fdd6c01df82058bf523a767e88d7049ae (diff)
fix bug with size of small structures, and parsing them
Diffstat (limited to 'src/analyzer.js')
-rw-r--r--src/analyzer.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/analyzer.js b/src/analyzer.js
index 4a692826..d1039e1c 100644
--- a/src/analyzer.js
+++ b/src/analyzer.js
@@ -197,7 +197,9 @@ function analyzer(data) {
} else if (dedup(diffs).length == 1) {
type.flatFactor = diffs[0];
}
- type.flatSize = Runtime.alignMemory(type.flatSize); // final padding at end
+ if (type.flatSize > QUANTUM_SIZE) {
+ type.flatSize = Runtime.alignMemory(type.flatSize); // final padding at end
+ }
type.needsFlattening = (this.flatFactor != 1);
dprint('types', 'type: ' + type.name_ + ' : ' + JSON.stringify(type.fields));
dprint('types', ' has final size of ' + type.flatSize + ', flatting: ' + type.needsFlattening + ' ? ' + (type.flatFactor ? type.flatFactor : JSON.stringify(type.flatIndexes)));