refactor: unwrap Heap namespace + self-reexport (#22931)

This commit is contained in:
Kit Langton
2026-04-17 00:01:37 +00:00
committed by GitHub
parent fdd5b77bfd
commit f6dbb2f3e0
+6 -6
View File
@@ -8,12 +8,11 @@ const log = Log.create({ service: "heap" })
const MINUTE = 60_000 const MINUTE = 60_000
const LIMIT = 2 * 1024 * 1024 * 1024 const LIMIT = 2 * 1024 * 1024 * 1024
export namespace Heap { let timer: Timer | undefined
let timer: Timer | undefined let lock = false
let lock = false let armed = true
let armed = true
export function start() { export function start() {
if (!Flag.OPENCODE_AUTO_HEAP_SNAPSHOT) return if (!Flag.OPENCODE_AUTO_HEAP_SNAPSHOT) return
if (timer) return if (timer) return
@@ -55,5 +54,6 @@ export namespace Heap {
void run() void run()
}, MINUTE) }, MINUTE)
timer.unref?.() timer.unref?.()
}
} }
export * as Heap from "./heap"