Skip to content

Commit

Permalink
Merge pull request tmm1#111 from Confusion/patch-1
Browse files Browse the repository at this point in the history
Fix a compilation error and a compilation warning with clang 6.0
  • Loading branch information
tenderlove authored Sep 26, 2019
2 parents 1128a31 + b886c3c commit 1d5ae02
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ext/stackprof/stackprof.c
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ stackprof_record_gc_samples()

// We don't know when the GC samples were actually marked, so let's
// assume that they were marked at a perfectly regular interval.
delta_to_first_unrecorded_gc_sample = (1000 * diff.tv_sec + diff.tv_usec) - (_stackprof.unrecorded_gc_samples - 1) * _stackprof.interval;
delta_to_first_unrecorded_gc_sample = (1000 * diff.tv_sec + diff.tv_usec) - (_stackprof.unrecorded_gc_samples - 1) * NUM2LONG(_stackprof.interval);
if (delta_to_first_unrecorded_gc_sample < 0) {
delta_to_first_unrecorded_gc_sample = 0;
}
Expand All @@ -526,7 +526,7 @@ stackprof_record_gc_samples()
_stackprof.lines_buffer[0] = 0;

for (i = 0; i < _stackprof.unrecorded_gc_samples; i++) {
int timestamp_delta = i == 0 ? delta_to_first_unrecorded_gc_sample : _stackprof.interval;
int timestamp_delta = i == 0 ? delta_to_first_unrecorded_gc_sample : NUM2LONG(_stackprof.interval);
stackprof_record_sample_for_stack(1, timestamp_delta);
}
_stackprof.during_gc += _stackprof.unrecorded_gc_samples;
Expand Down

0 comments on commit 1d5ae02

Please sign in to comment.