MmapPool: Merge blocks on deallocation if possible

This commit is contained in:
2017-01-05 14:25:54 +01:00
parent a35e04c049
commit 8e0b742748
4 changed files with 37 additions and 27 deletions

View File

@ -298,6 +298,7 @@ struct Vector(T)
}
// Reserves memory to store len objects and initializes it.
// Doesn't change the length.
private void initialize(in size_t len)
{
reserve(len);
@ -316,7 +317,7 @@ struct Vector(T)
}
else
{
memset(vector + length_, 0, len * T.sizeof);
memset(vector + length_, 0, (len - length_) * T.sizeof);
}
}