aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/preamble.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/preamble.js b/src/preamble.js
index 293ddcf6..51e22390 100644
--- a/src/preamble.js
+++ b/src/preamble.js
@@ -461,10 +461,10 @@ function allocate(slab, types, allocator) {
size = slab.length;
}
- var ret = [_malloc, Runtime.stackAlloc, Runtime.staticAlloc][allocator === undefined ? ALLOC_STATIC : allocator](Math.max(size, 1));
-
var singleType = typeof types === 'string' ? types : null;
+ var ret = [_malloc, Runtime.stackAlloc, Runtime.staticAlloc][allocator === undefined ? ALLOC_STATIC : allocator](Math.max(size, singleType ? 1 : types.length));
+
var i = 0, type;
while (i < size) {
var curr = zeroinit ? 0 : slab[i];