MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / makeSetValue

Function makeSetValue

src/parseTools.mjs:507–515  ·  view source on GitHub ↗

* @param {number} ptr The pointer. Used to find both the slab and the offset in that slab. If the pointer * is just an integer, then this is almost redundant, but in general the pointer type * may in the future include information about which slab as well. So, for now it is

(ptr, pos, value, type)

Source from the content-addressed store, hash-verified

505 * @return {string} JS code for performing the memory set operation
506 */
507function makeSetValue(ptr, pos, value, type) {
508 var rtn = makeSetValueImpl(ptr, pos, value, type);
509 if (ASSERTIONS == 2 && (type.startsWith('i') || type.startsWith('u'))) {
510 const width = getBitWidth(type);
511 const assertion = `checkInt${width}(${value})`;
512 rtn += `;${assertion}`;
513 }
514 return rtn;
515}
516
517function makeSetValueImpl(ptr, pos, value, type) {
518 if (type == 'i64' && !WASM_BIGINT) {

Callers 15

test_parseTools.jsFile · 0.85
writeStackCookieFunction · 0.85
audio_worklet.jsFile · 0.85
Fetch.jsFile · 0.85
saveResponseAndStatusFunction · 0.85
setF32SampleFunction · 0.85
setI16SampleFunction · 0.85
setU8SampleFunction · 0.85
libopenal.jsFile · 0.85
switchFunction · 0.85
libglfw.jsFile · 0.85
libbrowser.jsFile · 0.85

Calls 2

makeSetValueImplFunction · 0.85
getBitWidthFunction · 0.85

Tested by

no test coverage detected