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

Function ___syscall91

js/sql-debug.js:4932–4953  ·  view source on GitHub ↗
(which, varargs)

Source from the content-addressed store, hash-verified

4930 }
4931
4932 function ___syscall91(which, varargs) {SYSCALLS.varargs = varargs;
4933 try {
4934 // munmap
4935 var addr = SYSCALLS.get(), len = SYSCALLS.get();
4936 // TODO: support unmmap'ing parts of allocations
4937 var info = SYSCALLS.mappings[addr];
4938 if (!info) return 0;
4939 if (len === info.len) {
4940 var stream = FS.getStream(info.fd);
4941 SYSCALLS.doMsync(addr, stream, len, info.flags)
4942 FS.munmap(stream);
4943 SYSCALLS.mappings[addr] = null;
4944 if (info.allocated) {
4945 _free(info.malloc);
4946 }
4947 }
4948 return 0;
4949 } catch (e) {
4950 if (typeof FS === 'undefined' || !(e instanceof FS.ErrnoError)) abort(e);
4951 return -e.errno;
4952 }
4953 }
4954
4955 function ___syscall94(which, varargs) {SYSCALLS.varargs = varargs;
4956 try {

Callers 1

___munmapFunction · 0.70

Calls 2

_freeFunction · 0.85
abortFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…