Skip to content

Conversation

@thygrrr
Copy link
Contributor

@thygrrr thygrrr commented Oct 5, 2018

Changed ArrayPool so it will only work with Power of Two arrays. There are various questions that remain, including whether the mod as it is will work with this. Feeding the arrays given to compress into the cache, however, constitutes a memory leak; and if anyone who called compress reuses this array, this causes undefined corruption.

Fixes:

  • correct powers of two used (was a +1 error, and very bad effects for negative values)
  • tests adapted
  • new tests to prove we are actually recycling arrays

Last question:

…e are various questions that remain, including whether the game will work with this. Feeding the arrays given to compress into the cache, however, constitutes a memory leak; and if anyone who called compress reuses this array, this causes undefined corruption.
}

[TestMethod]
public void CompressDataReuseArrays()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to write a adapted version of this test, but it wouldn't work.

@thygrrr
Copy link
Contributor Author

thygrrr commented Oct 5, 2018

I don't think this should be merged. :( 👎 At least not before I find out why compress suddenly needs memory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants