Skip to content

Commit 9d23dad

Browse files
authored
Merge branch 'main' into whole-archive
2 parents c496181 + 06cebfc commit 9d23dad

File tree

112 files changed

+2810
-2161
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+2810
-2161
lines changed

ChangeLog.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,13 @@ to browse the changes between the tags.
1818

1919
See docs/process.md for more on how version tagging works.
2020

21-
3.1.73 (in development)
21+
3.1.74 (in development)
2222
-----------------------
23+
24+
3.1.73 - 11/28/24
25+
-----------------
2326
- libunwind was updated to LLVM 19.1.4. (#22394)
27+
- mimalloc was updated to 2.1.7. (#21548)
2428

2529
3.1.72 - 11/19/24
2630
-----------------

emscripten-version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.1.73-git
1+
3.1.74-git

src/cpuprofiler.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ var emscriptenCpuProfiler = {
593593
detectWebGLContext() {
594594
if (Module['canvas']?.GLctxObject?.GLctx) return Module['canvas'].GLctxObject.GLctx;
595595
else if (typeof GLctx != 'undefined') return GLctx;
596-
else if (Module.ctx) return Module.ctx;
596+
else if (Module['ctx']) return Module['ctx'];
597597
return null;
598598
},
599599

src/library_browser.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ var LibraryBrowser = {
192192
},
193193

194194
createContext(/** @type {HTMLCanvasElement} */ canvas, useWebGL, setInModule, webGLContextAttributes) {
195-
if (useWebGL && Module.ctx && canvas == Module['canvas']) return Module.ctx; // no need to recreate GL context if it's already been created for this canvas.
195+
if (useWebGL && Module['ctx'] && canvas == Module['canvas']) return Module['ctx']; // no need to recreate GL context if it's already been created for this canvas.
196196

197197
var ctx;
198198
var contextHandle;
@@ -235,7 +235,7 @@ var LibraryBrowser = {
235235
#if ASSERTIONS
236236
if (!useWebGL) assert(typeof GLctx == 'undefined', 'cannot set in module if GLctx is used, but we are a non-GL context that would replace it');
237237
#endif
238-
Module.ctx = ctx;
238+
Module['ctx'] = ctx;
239239
if (useWebGL) GL.makeContextCurrent(contextHandle);
240240
Browser.useWebGL = useWebGL;
241241
Browser.moduleContextCreatedCallbacks.forEach((callback) => callback());

src/library_eventloop.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ LibraryJSEventLoop = {
472472
}
473473

474474
#if ASSERTIONS
475-
if (MainLoop.method === 'timeout' && Module.ctx) {
475+
if (MainLoop.method === 'timeout' && Module['ctx']) {
476476
warnOnce('Looks like you are rendering without using requestAnimationFrame for the main loop. You should use 0 for the frame rate in emscripten_set_main_loop in order to use requestAnimationFrame, as that can greatly improve your frame rates!');
477477
MainLoop.method = ''; // just warn once per call to set main loop
478478
}

src/library_fs.js

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -666,15 +666,36 @@ FS.staticInit();
666666
}
667667
return parent.node_ops.mknod(parent, name, mode, dev);
668668
},
669+
statfs(path) {
670+
671+
// NOTE: None of the defaults here are true. We're just returning safe and
672+
// sane values.
673+
var rtn = {
674+
bsize: 4096,
675+
frsize: 4096,
676+
blocks: 1e6,
677+
bfree: 5e5,
678+
bavail: 5e5,
679+
files: FS.nextInode,
680+
ffree: FS.nextInode - 1,
681+
fsid: 42,
682+
flags: 2,
683+
namelen: 255,
684+
};
685+
686+
var parent = FS.lookupPath(path, {follow: true}).node;
687+
if (parent?.node_ops.statfs) {
688+
Object.assign(rtn, parent.node_ops.statfs(parent.mount.opts.root));
689+
}
690+
return rtn;
691+
},
669692
// helpers to create specific types of nodes
670-
create(path, mode) {
671-
mode = mode !== undefined ? mode : 438 /* 0666 */;
693+
create(path, mode = 0o666) {
672694
mode &= {{{ cDefs.S_IALLUGO }}};
673695
mode |= {{{ cDefs.S_IFREG }}};
674696
return FS.mknod(path, mode, 0);
675697
},
676-
mkdir(path, mode) {
677-
mode = mode !== undefined ? mode : 511 /* 0777 */;
698+
mkdir(path, mode = 0o777) {
678699
mode &= {{{ cDefs.S_IRWXUGO }}} | {{{ cDefs.S_ISVTX }}};
679700
mode |= {{{ cDefs.S_IFDIR }}};
680701
#if FS_DEBUG
@@ -701,7 +722,7 @@ FS.staticInit();
701722
mkdev(path, mode, dev) {
702723
if (typeof dev == 'undefined') {
703724
dev = mode;
704-
mode = 438 /* 0666 */;
725+
mode = 0o666;
705726
}
706727
mode |= {{{ cDefs.S_IFCHR }}};
707728
return FS.mknod(path, mode, dev);
@@ -809,7 +830,7 @@ FS.staticInit();
809830
// do the underlying fs rename
810831
try {
811832
old_dir.node_ops.rename(old_node, new_dir, new_name);
812-
// update old node (we do this here to avoid each backend
833+
// update old node (we do this here to avoid each backend
813834
// needing to)
814835
old_node.parent = new_dir;
815836
} catch (e) {
@@ -904,7 +925,7 @@ FS.staticInit();
904925
if (!link.node_ops.readlink) {
905926
throw new FS.ErrnoError({{{ cDefs.EINVAL }}});
906927
}
907-
return PATH_FS.resolve(FS.getPath(link.parent), link.node_ops.readlink(link));
928+
return link.node_ops.readlink(link);
908929
},
909930
stat(path, dontFollow) {
910931
var lookup = FS.lookupPath(path, { follow: !dontFollow });
@@ -1009,13 +1030,12 @@ FS.staticInit();
10091030
timestamp: Math.max(atime, mtime)
10101031
});
10111032
},
1012-
open(path, flags, mode) {
1033+
open(path, flags, mode = 0o666) {
10131034
if (path === "") {
10141035
throw new FS.ErrnoError({{{ cDefs.ENOENT }}});
10151036
}
10161037
flags = typeof flags == 'string' ? FS_modeStringToFlags(flags) : flags;
10171038
if ((flags & {{{ cDefs.O_CREAT }}})) {
1018-
mode = typeof mode == 'undefined' ? 438 /* 0666 */ : mode;
10191039
mode = (mode & {{{ cDefs.S_IALLUGO }}}) | {{{ cDefs.S_IFREG }}};
10201040
} else {
10211041
mode = 0;
@@ -1381,7 +1401,7 @@ FS.staticInit();
13811401
FS.mkdir('/proc/self/fd');
13821402
FS.mount({
13831403
mount() {
1384-
var node = FS.createNode(proc_self, 'fd', {{{ cDefs.S_IFDIR }}} | 511 /* 0777 */, {{{ cDefs.S_IXUGO }}});
1404+
var node = FS.createNode(proc_self, 'fd', {{{ cDefs.S_IFDIR | 0o777 }}}, {{{ cDefs.S_IXUGO }}});
13851405
node.node_ops = {
13861406
lookup(parent, name) {
13871407
var fd = +name;

src/library_glfw.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,7 +1108,7 @@ var LibraryGLFW = {
11081108
}
11091109

11101110
// If context creation failed, do not return a valid window
1111-
if (!Module.ctx && useWebGL) return 0;
1111+
if (!Module['ctx'] && useWebGL) return 0;
11121112

11131113
// Initializes the framebuffer size from the canvas
11141114
const canvas = Module['canvas'];
@@ -1144,7 +1144,7 @@ var LibraryGLFW = {
11441144
for (var i = 0; i < GLFW.windows.length; i++)
11451145
if (GLFW.windows[i] !== null) return;
11461146

1147-
delete Module.ctx;
1147+
delete Module['ctx'];
11481148
},
11491149

11501150
swapBuffers: (winid) => {

src/library_glut.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ var LibraryGLUT = {
575575
glutDestroyWindow__proxy: 'sync',
576576
glutDestroyWindow__deps: ['$Browser'],
577577
glutDestroyWindow: (name) => {
578-
delete Module.ctx;
578+
delete Module['ctx'];
579579
return 1;
580580
},
581581

src/library_html5_webgl.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ var LibraryHtml5WebGL = {
223223
});`,
224224
#endif
225225
_emscripten_proxied_gl_context_activated_from_main_browser_thread: (contextHandle) => {
226-
GLctx = Module.ctx = GL.currentContext = contextHandle;
226+
GLctx = Module['ctx'] = GL.currentContext = contextHandle;
227227
GL.currentContextIsProxied = true;
228228
},
229229
#else

src/library_lz4.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
addToLibrary({
99
$LZ4__deps: ['$FS', '$preloadPlugins'],
1010
$LZ4: {
11-
DIR_MODE: {{{ cDefs.S_IFDIR }}} | 511 /* 0777 */,
12-
FILE_MODE: {{{ cDefs.S_IFREG }}} | 511 /* 0777 */,
11+
DIR_MODE: {{{ cDefs.S_IFDIR | 0o777 }}},
12+
FILE_MODE: {{{ cDefs.S_IFREG | 0o777 }}},
1313
CHUNK_SIZE: -1,
1414
codec: null,
1515
init() {

0 commit comments

Comments
 (0)