FYI: DotMemoryUnit IDisposable seems to work only if the compiler inlines the functions

I followed your instructions at and for debug reasons I added some output in the constructor and the "Dispose" method.

With the extended methods, tests that should fail because of memory assertions have passed. It seems that the behavior depends on whether the compiler inlines the functions or not.

I thought that someone else might stumble upon the same problem and therefore I wanted to share it here. Maybe you would like to add a short information on the linked instruction page.

For clarification I uploaded some source code that shows the behavior:

1 comment
Comment actions Permalink
Official comment

Hello Lukas,

Unfortunately it's really an issue which occurs by some reasons related to the test method detection. We're planning to find a way to avoid such issues, so be pleasured to follow this issue:

Thank you for your comment and code example.

Please sign in to leave a comment.