Skip to content

Commit

Permalink
use REALLOC_N
Browse files Browse the repository at this point in the history
  • Loading branch information
tmm1 committed Sep 18, 2012
1 parent 3b4c60f commit 36e3f70
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ext/rblineprof.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ profiler_hook(rb_event_t event, NODE *node, VALUE self, ID mid, VALUE klass)
if (sourcefile->last_line >= sourcefile->nlines) {
long prev_nlines = sourcefile->nlines;
sourcefile->nlines = sourcefile->last_line + 100;
sourcefile->lines = realloc(sourcefile->lines, sizeof(uint64_t) * sourcefile->nlines);
REALLOC_N(sourcefile->lines, uint64_t, sourcefile->nlines);
memset(sourcefile->lines + prev_nlines, 0, sizeof(uint64_t) * (sourcefile->nlines - prev_nlines));
}

Expand Down

0 comments on commit 36e3f70

Please sign in to comment.