Skip to content

Commit

Permalink
Merge pull request #4707 from WalterBright/sorting-ptr
Browse files Browse the repository at this point in the history
fix .ptr safety problem in schwartzSort()
  • Loading branch information
9il authored Aug 3, 2016
2 parents 5422d26 + 03a5eae commit dab3eda
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions std/algorithm/sorting.d
Original file line number Diff line number Diff line change
Expand Up @@ -2190,12 +2190,12 @@ schwartzSort(alias transform, alias less = "a < b",
{
foreach (i; 0 .. length) collectException(destroy(xform1[i]));
}
static void trustedFree(T* p) @trusted
static void trustedFree(T[] p) @trusted
{
import core.stdc.stdlib : free;
free(p);
free(p.ptr);
}
trustedFree(xform1.ptr);
trustedFree(xform1);
}
for (; length != r.length; ++length)
{
Expand Down

0 comments on commit dab3eda

Please sign in to comment.