Skip to content

Commit

Permalink
Fix a bug in which a potentially invalid usize replaced size
Browse files Browse the repository at this point in the history
In the refactoring that unified the allocation paths, usize was substituted for
size. This worked fine under the default test configuration, but triggered
asserts when we started beefing up our CI testing.

This change fixes the issue, and clarifies the comment describing the argument
selection that it got wrong.
  • Loading branch information
davidtgoldblatt committed Jan 25, 2017
1 parent 0874b64 commit 85d2841
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/jemalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1652,10 +1652,10 @@ imalloc_body(static_opts_t *sopts, dynamic_opts_t *dopts) {
/*
* If dopts->alignment > 0, then ind is still 0, but usize was
* computed in the previous if statement. Down the positive
* alignment path, imalloc_no_sample ind and size (relying only
* on usize).
* alignment path, imalloc_no_sample ignores ind and size
* (relying only on usize).
*/
allocation = imalloc_no_sample(sopts, dopts, tsd, usize, usize,
allocation = imalloc_no_sample(sopts, dopts, tsd, size, usize,
ind);
if (unlikely(allocation == NULL)) {
goto label_oom;
Expand Down

0 comments on commit 85d2841

Please sign in to comment.