@type {function(number, string, boolean=)}
(ptr, type, noSafe)
| 558 | |
| 559 | /** @type {function(number, string, boolean=)} */ |
| 560 | function getValue(ptr, type, noSafe) { |
| 561 | type = type || 'i8'; |
| 562 | if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit |
| 563 | switch(type) { |
| 564 | case 'i1': return HEAP8[((ptr)>>0)]; |
| 565 | case 'i8': return HEAP8[((ptr)>>0)]; |
| 566 | case 'i16': return HEAP16[((ptr)>>1)]; |
| 567 | case 'i32': return HEAP32[((ptr)>>2)]; |
| 568 | case 'i64': return HEAP32[((ptr)>>2)]; |
| 569 | case 'float': return HEAPF32[((ptr)>>2)]; |
| 570 | case 'double': return HEAPF64[((ptr)>>3)]; |
| 571 | default: abort('invalid type for getValue: ' + type); |
| 572 | } |
| 573 | return null; |
| 574 | } |
| 575 | |
| 576 | |
| 577 | var ALLOC_NORMAL = 0; // Tries to use _malloc() |
no test coverage detected
searching dependent graphs…