aboutsummaryrefslogtreecommitdiff
path: root/src/library_gc.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/library_gc.js')
-rw-r--r--src/library_gc.js14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/library_gc.js b/src/library_gc.js
index ccf6656d..bf0a6aff 100644
--- a/src/library_gc.js
+++ b/src/library_gc.js
@@ -16,13 +16,15 @@ if (GC_SUPPORT) {
init: function() {
assert(!GC.initted);
GC.initted = true;
-#if GENERATING_HTML
- setInterval(function() {
- GC.maybeCollect();
- }, 1000);
-#else
- // No HTML intervals, so you need to call GC.maybeCollect() or GC.collect() manually
+ if (ENVIRONMENT_IS_WEB) {
+ setInterval(function() {
+ GC.maybeCollect();
+ }, 1000);
+ } else {
+#if ASSERTIONS
+ Module.print('No HTML intervals, so you need to call GC.maybeCollect() or GC.collect() manually');
#endif
+ }
},
malloc: function(bytes, clear, scannable) {