From bd12a8be71fb6774da0f68141cf07f33e5145c86 Mon Sep 17 00:00:00 2001 From: bptato Date: Tue, 27 Dec 2022 15:23:47 +0100 Subject: dom: fix collection caching Use ids instead of pure pointers, so we can utilize the JS finalizer. --- src/display/client.nim | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/display') diff --git a/src/display/client.nim b/src/display/client.nim index 2e6528a3..928fd32d 100644 --- a/src/display/client.nim +++ b/src/display/client.nim @@ -446,6 +446,12 @@ proc nimGCStats(client: Client): string {.jsfunc.} = proc jsGCStats(client: Client): string {.jsfunc.} = return client.jsrt.getMemoryUsage() +proc nimCollect(client: Client) {.jsfunc.} = + GC_fullCollect() + +proc jsCollect(client: Client) {.jsfunc.} = + JS_RunGC(client.jsrt) + proc show(console: Console) {.jsfunc.} = if console.pager.container != console.container: console.prev = console.pager.container -- cgit 1.4.1-2-gfad0