Skip to content

Prefer mutex typedefs provided by musl #24842

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions system/lib/libc/musl/arch/emscripten/bits/alltypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,18 +93,6 @@ typedef struct { union { int __i[10]; volatile int __vi[10]; unsigned long __s[1
#endif


// TODO(kleisauke): Remove these two typedefs.
#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
typedef struct { union { int __i[6]; volatile int __vi[6]; volatile void * /*volatile*/__p[6]; } __u; } pthread_mutex_t;
#define __DEFINED_pthread_mutex_t
#endif

#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
typedef struct { union { int __i[6]; volatile int __vi[6]; volatile void * /*volatile*/__p[6]; } __u; } mtx_t;
#define __DEFINED_mtx_t
#endif


// END EMSCRIPTEN-SPECIFIC DEFINITIONS
//
// Below here are the shared musl definitions. The emscripten-specific definitions above will take precedence
Expand Down
4 changes: 0 additions & 4 deletions system/lib/libc/musl/arch/emscripten/bits/alltypes.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ TYPEDEF struct { alignas(8) long long __ll; long double __ld; } max_align_t;
// to pass a pointer to a string denoting the WebGL canvases to transfer.
TYPEDEF struct { union { int __i[10]; volatile int __vi[10]; unsigned long __s[10]; } __u; const char *_a_transferredcanvases; } pthread_attr_t;

// TODO(kleisauke): Remove these two typedefs.
TYPEDEF struct { union { int __i[6]; volatile int __vi[6]; volatile void * /*volatile*/__p[6]; } __u; } pthread_mutex_t;
TYPEDEF struct { union { int __i[6]; volatile int __vi[6]; volatile void * /*volatile*/__p[6]; } __u; } mtx_t;

// END EMSCRIPTEN-SPECIFIC DEFINITIONS
//
// Below here are the shared musl definitions. The emscripten-specific definitions above will take precedence
Expand Down
8 changes: 4 additions & 4 deletions test/code_size/test_codesize_minimal_pthreads.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"a.out.js": 7581,
"a.out.js.gz": 3736,
"a.out.nodebug.wasm": 19590,
"a.out.nodebug.wasm.gz": 9031,
"total": 27171,
"total_gz": 12767,
"a.out.nodebug.wasm": 19588,
"a.out.nodebug.wasm.gz": 9025,
"total": 27169,
"total_gz": 12761,
"sent": [
"a (memory)",
"b (emscripten_get_now)",
Expand Down
8 changes: 4 additions & 4 deletions test/code_size/test_codesize_minimal_pthreads_memgrowth.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"a.out.js": 8012,
"a.out.js.gz": 3939,
"a.out.nodebug.wasm": 19591,
"a.out.nodebug.wasm.gz": 9031,
"total": 27603,
"total_gz": 12970,
"a.out.nodebug.wasm": 19589,
"a.out.nodebug.wasm.gz": 9025,
"total": 27601,
"total_gz": 12964,
"sent": [
"a (memory)",
"b (emscripten_get_now)",
Expand Down