MCPcopy Index your code
hub / github.com/sql-js/sql.js / getValue

Function getValue

js/sql-debug.js:560–574  ·  view source on GitHub ↗

@type {function(number, string, boolean=)}

(ptr, type, noSafe)

Source from the content-addressed store, hash-verified

558
559/** @type {function(number, string, boolean=)} */
560function 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
577var ALLOC_NORMAL = 0; // Tries to use _malloc()

Callers 2

DatabaseFunction · 0.70
sql-debug.jsFile · 0.70

Calls 1

abortFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…