aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/bindings/JSCUSocketsLoopIntegration.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/bun.js/bindings/JSCUSocketsLoopIntegration.cpp')
-rw-r--r--src/bun.js/bindings/JSCUSocketsLoopIntegration.cpp12
1 files changed, 12 insertions, 0 deletions
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