Skip to content

Commit

Permalink
Adjust external allocated memory less often (#429)
Browse files Browse the repository at this point in the history
Stop using AdjustAmountOfExternalAllocatedMemory entirely.

#429 (comment)
  • Loading branch information
benjamn authored and laverdet committed Jan 7, 2020
1 parent f882017 commit a63d776
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions src/fibers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,6 @@

#define THROW(x, m) return uni::Return(uni::ThrowException(Isolate::GetCurrent(), x(uni::NewLatin1String(Isolate::GetCurrent(), m))), args)

// Run GC more often when debugging
#ifdef DEBUG
#define GC_ADJUST 100
#else
#define GC_ADJUST 1
#endif

using namespace std;
using namespace v8;

Expand Down Expand Up @@ -578,7 +571,6 @@ class Fiber {
THROW(Exception::RangeError, "Out of memory");
}
that.started = true;
uni::AdjustAmountOfExternalAllocatedMemory(that.isolate, that.this_fiber->size() * GC_ADJUST);
} else {
// If the fiber is currently running put the first parameter to `run()` on `yielded`, then
// the pending call to `yield()` will return that value. `yielded` in this case is just a
Expand Down Expand Up @@ -758,10 +750,6 @@ class Fiber {
that.yielded_exception = false;
}

// Do not invoke the garbage collector if there's no context on the stack. It will seg fault
// otherwise.
uni::AdjustAmountOfExternalAllocatedMemory(that.isolate, -(int)(that.this_fiber->size() * GC_ADJUST));

// Don't make weak until after notifying the garbage collector. Otherwise it may try and
// free this very fiber!
if (!that.zombie) {
Expand Down

0 comments on commit a63d776

Please sign in to comment.