~ubuntu-branches/ubuntu/vivid/emscripten/vivid

« back to all changes in this revision

Viewing changes to src/library_gc.js

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2013-06-11 15:45:24 UTC
  • mfrom: (1.2.1) (2.1.1 experimental)
  • Revision ID: package-import@ubuntu.com-20130611154524-rppb3w6tixlegv4n
Tags: 1.4.7~20130611~a1eb425-1
* New snapshot release
* Upload to unstable

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
        _GC_finalizer_notifier = _malloc(4); setValue(_GC_finalizer_notifier, 0, 'i32');
27
27
 
28
28
        if (ENVIRONMENT_IS_WEB) {
29
 
          setInterval(function() {
 
29
          Browser.safeSetInterval(function() {
30
30
            GC.maybeCollect();
31
31
          }, 1000);
32
32
        } else {
148
148
      prep: function() { // Clear reachables and scan for roots
149
149
        GC.reachable = {}; // 1 if reachable. XXX
150
150
        GC.reachableList = []; // each reachable is added once to this. XXX
151
 
        // static data areas
152
 
        var staticStart = STACK_MAX;
153
 
        var staticEnd = _sbrk.DYNAMIC_START || STATICTOP; // after DYNAMIC_START, sbrk manages it (but it might not exist yet)
154
 
        GC.scan(staticStart, staticEnd);
 
151
        GC.scan(STATIC_BASE, STATICTOP);
155
152
        // TODO: scan stack and registers. Currently we assume we run from a timeout or such, so no stack/regs
156
 
        //    stack: STACK_ROOT to STACKTOP
 
153
        //    stack: STACK_BASE to STACKTOP
157
154
        //    registers: call scanners
158
155
      },
159
156