Skip to content

Remove use of legacy proxy API from library_html5.js. NFC - #20370

Merged
sbc100 merged 1 commit into
emscripten-core:mainfrom
sbc100:remove_use_of_legacy_proxy_api
Oct 3, 2023
Merged

Remove use of legacy proxy API from library_html5.js. NFC#20370
sbc100 merged 1 commit into
emscripten-core:mainfrom
sbc100:remove_use_of_legacy_proxy_api

Conversation

@sbc100

@sbc100 sbc100 commented Oct 2, 2023

Copy link
Copy Markdown
Collaborator

AFAICT this is the final usage of the legacy proxy API within emscripten.

@sbc100
sbc100 requested a review from tlively October 2, 2023 18:33
@sbc100
sbc100 force-pushed the remove_use_of_legacy_proxy_api branch from 99bae4f to 1cb518d Compare October 2, 2023 19:43
Comment thread system/lib/html5/callback.c Outdated
static void do_callback(void* arg) {
callback_args_t* args = (callback_args_t*)arg;
args->callback(args->event_type, args->event_data, args->user_data);
free(arg);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to free since arg is stack allocated.

AFAICT this is the final usage of the legacy proxy API within
emscripten.
@sbc100
sbc100 force-pushed the remove_use_of_legacy_proxy_api branch from 1cb518d to e58cb95 Compare October 2, 2023 23:23
@sbc100
sbc100 merged commit c41f659 into emscripten-core:main Oct 3, 2023
@sbc100
sbc100 deleted the remove_use_of_legacy_proxy_api branch October 3, 2023 16:36
stbergmann added a commit to stbergmann/emscripten that referenced this pull request Aug 23, 2024
...fixing a regression introduced in c41f659
"Remove use of legacy proxy API from library_html5.js. NFC (emscripten-core#20370)".

Fixes: emscripten-core#22442
stbergmann added a commit to stbergmann/emscripten that referenced this pull request Sep 3, 2024
...fixing a regression introduced in c41f659
"Remove use of legacy proxy API from library_html5.js. NFC (emscripten-core#20370)".

Fixes: emscripten-core#22442
stbergmann added a commit to stbergmann/emscripten that referenced this pull request Sep 16, 2024
...fixing a regression introduced in c41f659
"Remove use of legacy proxy API from library_html5.js. NFC (emscripten-core#20370)".

Fixes: emscripten-core#22442
stbergmann added a commit to allotropia/emscripten that referenced this pull request Sep 18, 2024
...fixing a regression introduced in c41f659
"Remove use of legacy proxy API from library_html5.js. NFC (emscripten-core#20370)".

Fixes: emscripten-core#22442

(cherry-picked from 17f1bb7 at
<emscripten-core#22443> "Make
_emscripten_run_callback_on_thread asynchronous")
sbc100 pushed a commit that referenced this pull request Nov 6, 2024
Fixes a regression introduced in
c41f659 "Remove use of legacy proxy API
from library_html5.js. NFC (#20370)".

Fixes: #22442
sbc100 added a commit to sbc100/emscripten that referenced this pull request Nov 12, 2025
I believe that we started leaking the event data for cross-thread html5
events in emscripten-core#20370.

Prior to that change we use `_emscripten_dispatch_to_thread` which took
care of free'ing the event data once it was consumed on the target
thread.

After this change we copy make copy of the event strut in
`_emscripten_run_callback_on_thread` and then free it once the callback
is run.

This change also avoid an extra malloc per event.
sbc100 added a commit to sbc100/emscripten that referenced this pull request Nov 12, 2025
I believe that we started leaking the event data for cross-thread html5
events in emscripten-core#20370.

Prior to that change we use `_emscripten_dispatch_to_thread` which took
care of free'ing the event data once it was consumed on the target
thread.

After this change we copy make copy of the event strut in
`_emscripten_run_callback_on_thread` and then free it once the callback
is run.

This change also avoid an extra malloc per event.
sbc100 added a commit to sbc100/emscripten that referenced this pull request Nov 12, 2025
I believe that we started leaking the event data for cross-thread html5
events in emscripten-core#20370.

Prior to that change we use `_emscripten_dispatch_to_thread` which took
care of free'ing the event data once it was consumed on the target
thread.

After this change we copy make copy of the event strut in
`_emscripten_run_callback_on_thread` and then free it once the callback
is run.

This change also avoid an extra malloc per event.
sbc100 added a commit to sbc100/emscripten that referenced this pull request Nov 12, 2025
I believe that we started leaking the event data for cross-thread html5
events in emscripten-core#20370.

Prior to that change we use `_emscripten_dispatch_to_thread` which took
care of free'ing the event data once it was consumed on the target
thread.

After this change we copy make copy of the event strut in
`_emscripten_run_callback_on_thread` and then free it once the callback
is run.

This change also avoid an extra malloc per event.
sbc100 added a commit to sbc100/emscripten that referenced this pull request Nov 12, 2025
I believe that we started leaking the event data for cross-thread html5
events in emscripten-core#20370.

Prior to that change we use `_emscripten_dispatch_to_thread` which took
care of free'ing the event data once it was consumed on the target
thread.

After this change we copy make copy of the event strut in
`_emscripten_run_callback_on_thread` and then free it once the callback
is run.

This change also avoid an extra malloc per event.
sbc100 added a commit to sbc100/emscripten that referenced this pull request Nov 12, 2025
I believe that we started leaking the event data for cross-thread html5
events in emscripten-core#20370.

Prior to that change we use `_emscripten_dispatch_to_thread` which took
care of free'ing the event data once it was consumed on the target
thread.

After this change we copy make copy of the event strut in
`_emscripten_run_callback_on_thread` and then free it once the callback
is run.

This change also avoid an extra malloc per event.
sbc100 added a commit to sbc100/emscripten that referenced this pull request Nov 12, 2025
I believe that we started leaking the event data for cross-thread html5
events in emscripten-core#20370.

Prior to that change we use `_emscripten_dispatch_to_thread` which took
care of free'ing the event data once it was consumed on the target
thread.

After this change we copy make copy of the event strut in
`_emscripten_run_callback_on_thread` and then free it once the callback
is run.

This change also avoid an extra malloc per event.
sbc100 added a commit to sbc100/emscripten that referenced this pull request Nov 12, 2025
I believe that we started leaking the event data for cross-thread html5
events in emscripten-core#20370.

Prior to that change we use `_emscripten_dispatch_to_thread` which took
care of free'ing the event data once it was consumed on the target
thread.

After this change we copy make copy of the event strut in
`_emscripten_run_callback_on_thread` and then free it once the callback
is run.

This change also avoid an extra malloc per event.
sbc100 added a commit that referenced this pull request Nov 12, 2025
I believe that we started leaking the event data for cross-thread html5
events in #20370.

Prior to that change we use `_emscripten_dispatch_to_thread` which took
care of free'ing the event data once it was consumed on the target
thread.

After this change we copy make copy of the event strut in
`_emscripten_run_callback_on_thread` and then free it once the callback
is run.

This change also avoids an extra malloc per event, and cleans up
libhtml5.js a little.
inolen pushed a commit to inolen/emscripten that referenced this pull request Feb 13, 2026
I believe that we started leaking the event data for cross-thread html5
events in emscripten-core#20370.

Prior to that change we use `_emscripten_dispatch_to_thread` which took
care of free'ing the event data once it was consumed on the target
thread.

After this change we copy make copy of the event strut in
`_emscripten_run_callback_on_thread` and then free it once the callback
is run.

This change also avoids an extra malloc per event, and cleans up
libhtml5.js a little.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants