aboutsummaryrefslogtreecommitdiff
path: root/src/library_gc.js
diff options
context:
space:
mode:
authorBruce Mitchener <bruce.mitchener@gmail.com>2013-02-01 09:39:08 +0700
committerBruce Mitchener <bruce.mitchener@gmail.com>2013-02-01 09:39:08 +0700
commit3c33204a2d2614be4a3f9e17fc57537246864093 (patch)
treeae492e9dd454c601aabeec2900e46fd6e105b944 /src/library_gc.js
parent7740bad81fffe0f6029bf8dae91fbca5cbadf673 (diff)
Support GC_get_heap_size().
Diffstat (limited to 'src/library_gc.js')
-rw-r--r--src/library_gc.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/library_gc.js b/src/library_gc.js
index 0f110f36..3d1a0700 100644
--- a/src/library_gc.js
+++ b/src/library_gc.js
@@ -113,6 +113,10 @@ if (GC_SUPPORT) {
GC.finalizerArgs[ptr] = arg;
},
+ getHeapSize: function() {
+ return GC.totalAllocations;
+ },
+
maybeCollect: function() {
if (GC.needCollect()) GC.collect();
},
@@ -207,6 +211,11 @@ if (GC_SUPPORT) {
GC.registerFinalizer(ptr, func, arg, old_func, old_arg);
},
+ GC_get_heap_size__deps: ['$GC'],
+ GC_get_heap_size: function() {
+ return GC.getHeapSize();
+ },
+
GC_MAYBE_COLLECT__deps: ['$GC'],
GC_MAYBE_COLLECT: function() {
GC.maybeCollect();