Skip to content

Commit 6844a95

Browse files
authored
Remove unnecessary use of Runtime.getNativeFieldSize. NFC (#15234)
1 parent e274e49 commit 6844a95

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/parseTools.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ function checkSafeHeap() {
480480
}
481481

482482
function getHeapOffset(offset, type) {
483-
if (Runtime.getNativeFieldSize(type) > 4 && type == 'i64') {
483+
if (type == 'i64') {
484484
// we emulate 64-bit integer values as 32 in asmjs-unknown-emscripten, but not double
485485
type = 'i32';
486486
}

src/runtime.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ function getNativeTypeSize(type) {
4646
var Runtime = {
4747
getNativeTypeSize: getNativeTypeSize,
4848

49-
//! Returns the size of a structure field, as C/C++ would have it (in 32-bit,
50-
//! for now).
51-
//! @param type The type, by name.
49+
//! TODO(sbc): This function is unused by emscripten but we can't be
50+
//! sure there are not external users.
51+
//! See: https://github.com/emscripten-core/emscripten/issues/15242
5252
getNativeFieldSize: function(type) {
5353
return Math.max(getNativeTypeSize(type), Runtime.QUANTUM_SIZE);
5454
},

0 commit comments

Comments
 (0)