Skip to content

Commit d43311b

Browse files
authored
Completely disabled stdio file locking in single threaded builds. NFC (emscripten-core#26490)
1 parent b7c5169 commit d43311b

27 files changed

Lines changed: 107 additions & 116 deletions

system/lib/libc/musl/src/internal/stdio_impl.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,15 @@
66

77
#define UNGET 8
88

9+
#if defined(__EMSCRIPTEN__) && !defined(_REENTRANT)
10+
#define FFINALLOCK(f)
11+
#define FLOCK(f)
12+
#define FUNLOCK(f)
13+
#else
914
#define FFINALLOCK(f) ((f)->lock>=0 ? __lockfile((f)) : 0)
1015
#define FLOCK(f) int __need_unlock = ((f)->lock>=0 ? __lockfile((f)) : 0)
1116
#define FUNLOCK(f) do { if (__need_unlock) __unlockfile((f)); } while (0)
17+
#endif
1218

1319
#define F_PERM 1
1420
#define F_NORD 4

test/codesize/test_codesize_cxx_ctors1.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"a.out.js": 19214,
33
"a.out.js.gz": 7981,
4-
"a.out.nodebug.wasm": 132866,
5-
"a.out.nodebug.wasm.gz": 49893,
6-
"total": 152080,
7-
"total_gz": 57874,
4+
"a.out.nodebug.wasm": 132658,
5+
"a.out.nodebug.wasm.gz": 49938,
6+
"total": 151872,
7+
"total_gz": 57919,
88
"sent": [
99
"__cxa_throw",
1010
"_abort_js",

test/codesize/test_codesize_cxx_ctors2.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"a.out.js": 19191,
33
"a.out.js.gz": 7966,
4-
"a.out.nodebug.wasm": 132286,
5-
"a.out.nodebug.wasm.gz": 49547,
6-
"total": 151477,
7-
"total_gz": 57513,
4+
"a.out.nodebug.wasm": 132082,
5+
"a.out.nodebug.wasm.gz": 49598,
6+
"total": 151273,
7+
"total_gz": 57564,
88
"sent": [
99
"__cxa_throw",
1010
"_abort_js",

test/codesize/test_codesize_cxx_except.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"a.out.js": 22875,
33
"a.out.js.gz": 8956,
4-
"a.out.nodebug.wasm": 172744,
5-
"a.out.nodebug.wasm.gz": 57379,
6-
"total": 195619,
7-
"total_gz": 66335,
4+
"a.out.nodebug.wasm": 172547,
5+
"a.out.nodebug.wasm.gz": 57453,
6+
"total": 195422,
7+
"total_gz": 66409,
88
"sent": [
99
"__cxa_begin_catch",
1010
"__cxa_end_catch",

test/codesize/test_codesize_cxx_except_wasm.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"a.out.js": 19025,
33
"a.out.js.gz": 7908,
4-
"a.out.nodebug.wasm": 148139,
5-
"a.out.nodebug.wasm.gz": 55264,
6-
"total": 167164,
7-
"total_gz": 63172,
4+
"a.out.nodebug.wasm": 147940,
5+
"a.out.nodebug.wasm.gz": 55311,
6+
"total": 166965,
7+
"total_gz": 63219,
88
"sent": [
99
"_abort_js",
1010
"_tzset_js",

test/codesize/test_codesize_cxx_except_wasm_legacy.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"a.out.js": 19099,
33
"a.out.js.gz": 7930,
4-
"a.out.nodebug.wasm": 145945,
5-
"a.out.nodebug.wasm.gz": 54892,
6-
"total": 165044,
7-
"total_gz": 62822,
4+
"a.out.nodebug.wasm": 145746,
5+
"a.out.nodebug.wasm.gz": 54944,
6+
"total": 164845,
7+
"total_gz": 62874,
88
"sent": [
99
"_abort_js",
1010
"_tzset_js",

test/codesize/test_codesize_cxx_lto.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"a.out.js": 18562,
33
"a.out.js.gz": 7668,
4-
"a.out.nodebug.wasm": 102126,
5-
"a.out.nodebug.wasm.gz": 39426,
6-
"total": 120688,
7-
"total_gz": 47094,
4+
"a.out.nodebug.wasm": 101965,
5+
"a.out.nodebug.wasm.gz": 39470,
6+
"total": 120527,
7+
"total_gz": 47138,
88
"sent": [
99
"a (emscripten_resize_heap)",
1010
"b (_setitimer_js)",

test/codesize/test_codesize_cxx_mangle.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"a.out.js": 22925,
33
"a.out.js.gz": 8978,
4-
"a.out.nodebug.wasm": 239178,
5-
"a.out.nodebug.wasm.gz": 79777,
6-
"total": 262103,
7-
"total_gz": 88755,
4+
"a.out.nodebug.wasm": 238988,
5+
"a.out.nodebug.wasm.gz": 79856,
6+
"total": 261913,
7+
"total_gz": 88834,
88
"sent": [
99
"__cxa_begin_catch",
1010
"__cxa_end_catch",

test/codesize/test_codesize_cxx_noexcept.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"a.out.js": 19214,
33
"a.out.js.gz": 7981,
4-
"a.out.nodebug.wasm": 134873,
5-
"a.out.nodebug.wasm.gz": 50728,
6-
"total": 154087,
7-
"total_gz": 58709,
4+
"a.out.nodebug.wasm": 134678,
5+
"a.out.nodebug.wasm.gz": 50780,
6+
"total": 153892,
7+
"total_gz": 58761,
88
"sent": [
99
"__cxa_throw",
1010
"_abort_js",

test/codesize/test_codesize_cxx_wasmfs.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"a.out.js": 7053,
33
"a.out.js.gz": 3325,
4-
"a.out.nodebug.wasm": 172944,
5-
"a.out.nodebug.wasm.gz": 63301,
6-
"total": 179997,
7-
"total_gz": 66626,
4+
"a.out.nodebug.wasm": 172754,
5+
"a.out.nodebug.wasm.gz": 63338,
6+
"total": 179807,
7+
"total_gz": 66663,
88
"sent": [
99
"__cxa_throw",
1010
"_abort_js",

0 commit comments

Comments
 (0)