Conversation
|
Would the unit test be fine as is? |
| { | ||
| { nameof(AccurateAllocations.EightBytesArray), 8 + objectAllocationOverhead + arraySizeOverhead }, | ||
| { nameof(AccurateAllocations.SixtyFourBytesArray), 64 + objectAllocationOverhead + arraySizeOverhead }, | ||
| { nameof(AccurateAllocations.AllocateEmptyObject), objectAllocationOverhead }, |
There was a problem hiding this comment.
Missing AllocateTask (and the other test is missing the new AllocateEmptyObject).
There was a problem hiding this comment.
AllocateTask is the one that depends on SizeOfAllFields to calculate its expected size.
There was a problem hiding this comment.
Actually, I could also just set the expected value to a constant...
There was a problem hiding this comment.
I removed the AllocateEmptyObject because it didn't work with the normal and native toolchains. It allocated 24 bytes instead of 16 (objectAllocationOverhead and what CalculateRequiredSpace calculated for an empty class). It was the expected 2 * pointer size with Mono and MonoWasm though...
https://github.com/twobrainsgmbh/BenchmarkDotNet/actions/runs/22619464127/job/65540582849
Since this issue occurred with other toolchains then wasm, it seems out of scope for this PR.
There was a problem hiding this comment.
3 * ptr size is the minimum object size in CLR, I'm surprised mono is able to eliminate the padding.
f9df801 to
bfd2252
Compare
bfd2252 to
d1e518a
Compare
This PR enables the
MemoryDiagnoserto run on wasm.Resolves #2226