Skip to content

Size doesn't include Object Header and Method Table Ptr #38

@DmitryMak

Description

@DmitryMak

In the following printed layout, Size seems off by 16B because it does not include Object Header and Method Table Ptr:

Size: 40. Paddings: 11 (%27 of empty space) <-- Shouldn't Size be 56B instead?
|========================================|
| Object Header (8 bytes)                | <-- Not included in Size: 40
|----------------------------------------|
| Method Table Ptr (8 bytes)             | <-- Not included in Size: 40
|========================================|
|     0: Byte b (1 byte)                 |
|----------------------------------------|
|   1-7: padding (7 bytes)               |
|----------------------------------------|
|  8-19: NotAlignedStruct sp1 (12 bytes) |
| |================================|     |
| |     0: Byte m_byte1 (1 byte)   |     |
| |--------------------------------|     |
| |   1-3: padding (3 bytes)       |     |
| |--------------------------------|     |
| |   4-7: Int32 m_int (4 bytes)   |     |
| |--------------------------------|     |
| |     8: Byte m_byte2 (1 byte)   |     |
| |--------------------------------|     |
| |     9: padding (1 byte)        |     |
| |--------------------------------|     |
| | 10-11: Int16 m_short (2 bytes) |     |
| |================================|     |
|----------------------------------------|
| 20-23: padding (4 bytes)               |
|========================================|

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions