Skip to content

Commit edb65f8

Browse files
authored
Fix a memory growth issue with embind. (emscripten-core#9500)
Don't save a pointer to a HEAP while allocating. Fixes emscripten-core#9497
1 parent 801d177 commit edb65f8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/embind/embind.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -754,9 +754,9 @@ var LibraryEmbind = {
754754
},
755755
'toWireType': function(destructors, value) {
756756
// assumes 4-byte alignment
757-
var HEAP = getHeap();
758757
var length = value.length;
759758
var ptr = _malloc(4 + length * charSize);
759+
var HEAP = getHeap();
760760
HEAPU32[ptr >> 2] = length;
761761
var start = (ptr + 4) >> shift;
762762
for (var i = 0; i < length; ++i) {

0 commit comments

Comments
 (0)