Merge branch 'incoming' of github.com:lptr/emscripten into lptr-incoming

This commit is contained in:
Alon Zakai 2013-02-26 20:28:38 -05:00
Родитель f4cceb902a 73f24426c1
Коммит 8d0c65454d
2 изменённых файлов: 9 добавлений и 2 удалений

Просмотреть файл

@ -51,4 +51,5 @@ a license to everyone to use it as detailed in LICENSE.)
* Michael Bishop <mbtyke@gmail.com>
* Roger Braun <roger@rogerbraun.net>
* Vladimir Vukicevic <vladimir@pobox.com> (copyright owned by Mozilla Foundation)
* Lorant Pinter <lorant.pinter@prezi.com>

Просмотреть файл

@ -447,7 +447,7 @@ function allocate(slab, types, allocator, ptr) {
}
#endif
var i = 0, type;
var i = 0, type, typeSize, previousType;
while (i < size) {
var curr = slab[i];
@ -469,7 +469,13 @@ function allocate(slab, types, allocator, ptr) {
#endif
setValue(ret+i, curr, type);
i += Runtime.getNativeTypeSize(type);
// no need to look up size unless type changes, so cache it
if (previousType !== type) {
typeSize = Runtime.getNativeTypeSize(type);
previousType = type;
}
i += typeSize;
}
return ret;