diff options
author | Bruce Mitchener <bruce.mitchener@gmail.com> | 2013-02-01 09:39:08 +0700 |
---|---|---|
committer | Bruce Mitchener <bruce.mitchener@gmail.com> | 2013-02-01 09:39:08 +0700 |
commit | 3c33204a2d2614be4a3f9e17fc57537246864093 (patch) | |
tree | ae492e9dd454c601aabeec2900e46fd6e105b944 /src/library_gc.js | |
parent | 7740bad81fffe0f6029bf8dae91fbca5cbadf673 (diff) |
Support GC_get_heap_size().
Diffstat (limited to 'src/library_gc.js')
-rw-r--r-- | src/library_gc.js | 9 |
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(); |