Improve reference behavior
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- javascript, swift, wasm
- Ambito
- web-dev
Direzione di ricerca
Inizia con Runtime/src/index.ts, in particolare con SwiftRuntimeHeap.release(ref), e riproduci il report usando la modifica al logging mostrata nell’issue. Confronta le deallocazioni ripetute delle funzioni con la gestione desiderata delle funzioni del linguaggio JavaScript; il lavoro è completato quando viene implementato un comportamento concordato in modo che tali funzioni non vengano rilasciate erroneamente.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
I made a small change to report whenever an object ref is deleted:
---
Runtime/src/index.ts | 1 +
1 file changed, 1 insertion(+)
diff --git a/Runtime/src/index.ts b/Runtime/src/index.ts
index 0e641ff..ddfba4e 100644
--- a/Runtime/src/index.ts
+++ b/Runtime/src/index.ts
@@ -93,6 +93,7 @@ class SwiftRuntimeHeap {
release(ref: ref) {
const value = this._heapValueById.get(ref);
const isObject = typeof value == "object"
+ console.log('dereferencing', value);
if (isObject) {
const entry = this._heapEntryByValue.get(value)!;
entry.rc--;
(copy the content of the code block and run pbpaste | git apply in your terminal to make this change)
It reports many deallocations. The thing that caught my attention was the repeated deallocation of functions (like toString and hasOwnProperty). I wonder if there’s a way to recognize functions that are part of the JavaScript language and either dynamically call them when needed or mark them so they don’t get released.
- Lingua principale
- Swift
- Stelle
- 986
- Fork
- 76
- Merge medio
- 21h 11m
- PR unite (30g)
- 4
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di swiftwasm/JavaScriptKit
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
swiftwasm/JavaScriptKit#793 ·
-
swiftwasm/JavaScriptKit#785 · 1 assegnatario ·
-
[SwiftBuild] Preserve duplicate archive members when SwiftBuild expands static archives for linking Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
swiftwasm/JavaScriptKit#781 · 3 commenti ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
swiftwasm/JavaScriptKit#773 ·
-
swiftwasm/JavaScriptKit#767 · 1 assegnatario ·
Tutte le issue di swiftwasm/JavaScriptKit
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
maxgoedjen/secretive#840 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
manaflow-ai/cmux#13763 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
openwallet-foundation/multipaz#2028 ·