emscripten-core / emscripten-core/emscripten

WebIDL binder: Use WeakRefs in cache

Open
#9,854 7 comments 2 reactions 0 assignees View on GitHub
good first bug help wanted
Dominant language
C++
Stars
27.6k
Forks
3.6k
Avg merge
1d 1h
Merged PRs (30d)
105

Description

The cache maps C pointers (integers) to JS object wrappers. It
currently keeps objects alive forever. This is normally ok as the
objects should be manually `destroy()`ed, however, we do allow
wrapping a class as a parent class, and then it ends up in
multiple caches, see https://github.com/kripken/ammo.js/issues/284

Using WeakRefs where available could avoid this. However, until
they are present everywhere, perhaps we could analyze the
inheritance graph and clean up parent caches too, but that may
be tricky especially with multiple/virtual/etc. inheritance.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.