From 4bdec01619ee7db408b21477e1f7860d9bfdf789 Mon Sep 17 00:00:00 2001 From: Jarred Sumner Date: Thu, 28 Sep 2023 19:06:04 -0700 Subject: Reduce memory usage of HTTP server (#6135) Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> --- src/bun.js/bindings/JSCUSocketsLoopIntegration.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/bun.js/bindings/JSCUSocketsLoopIntegration.cpp (limited to 'src/bun.js/bindings/JSCUSocketsLoopIntegration.cpp') diff --git a/src/bun.js/bindings/JSCUSocketsLoopIntegration.cpp b/src/bun.js/bindings/JSCUSocketsLoopIntegration.cpp new file mode 100644 index 000000000..f607d586a --- /dev/null +++ b/src/bun.js/bindings/JSCUSocketsLoopIntegration.cpp @@ -0,0 +1,12 @@ +#include "root.h" +#include "JavaScriptCore/VM.h" + +extern "C" void bun_on_tick_before(JSC::VM* vm) +{ + // Let the GC do some work while we are idle + vm->heap.releaseAccess(); +} +extern "C" void bun_on_tick_after(JSC::VM* vm) +{ + vm->heap.acquireAccess(); +} \ No newline at end of file -- cgit v1.2.3