ObjectLayoutInspector
ObjectLayoutInspector copied to clipboard
Naming in print. `cell`1` but expect `cell<int>` or `cell{int}` or like. IntPtr vs void*.
I did next
https://github.com/OpenSharp/ObjectLayoutInspector/blob/master/src/ObjectLayoutInspector/ObjectLayoutInspector.Tests/UnsafeLinkedListTests.cs
which gives
Type layout for 'cell`1'
Size: 8 bytes. Paddings: 0 bytes (%0 of empty space)
|================================|
| 0-3: Int32 element (4 bytes) |
|--------------------------------|
| 4-7: Void* next (4 bytes) |
|================================|
Type layout for 'cellPtr`1'
Size: 8 bytes. Paddings: 0 bytes (%0 of empty space)
|================================|
| 0-3: Int32 element (4 bytes) |
|--------------------------------|
| 4-7: IntPtr next (4 bytes) |
|================================|
Type layout for 'intCell'
Size: 8 bytes. Paddings: 0 bytes (%0 of empty space)
|================================|
| 0-3: Int32 element (4 bytes) |
|--------------------------------|
| 4-7: intCell* next (4 bytes) |
|================================|
Type layout for 'intCellCell'
Size: 12 bytes. Paddings: 0 bytes (%0 of empty space)
|===========================================|
| 0-7: intCell element (8 bytes) |
| |================================| |
| | 0-3: Int32 element (4 bytes) | |
| |--------------------------------| |
| | 4-7: intCell* next (4 bytes) | |
| |================================| |
|-------------------------------------------|
| 8-11: intCellPointerCell* next (4 bytes) |
|===========================================|
Type layout for 'intCellPointerCell'
Size: 8 bytes. Paddings: 0 bytes (%0 of empty space)
|===========================================|
| 0-3: intCell* element (4 bytes) |
|-------------------------------------------|
| 4-7: intCellPointerCell* next (4 bytes) |
|===========================================|
I expect as soon as closed generic is given, then closed generic is printed in name.
Also I guess, but need to validate, that IntPtr
== void*
as of wideness/type and there could be single name for these in layout (i.e. different C# code, but same layout name).
https://msdn.microsoft.com/en-us/library/ms131236.aspx