Skip to content

was change in structure padding intended? #17640

@mithrendal

Description

@mithrendal

beginning with emcc 3.1.16 we see structure padding was changed from 4 bytes alignment to 8 bytes alignment.

was this done by intention? Normally 8 bytes alignment is for 64bit, but emsdk is still 32 bit ... no?
Can you tell us why the 4 bytes alignment was not sufficient anymore? Is emsdk maybe going 64 Bit soon ?

e.g.

struct SnapshotHeader {    
    // Magic bytes ('V','A','S','N','A','P')
    char magic[6];
    
    // Version number (major.minor.subminor['b'beta])
    u8 major;
    u8 minor;
    u8 subminor;
    u8 beta;

    //<--- here after byte 10, up to 3.1.15 emcc inserted a padding of 2 Bytes
    // to get the following struct aligned to an address divisable by 4 

    //<--- here after byte 10, 3.1.16 emcc and later inserts a padding of 6 Bytes
    // to get the following struct aligned to an address divisable by 8

    // this is the following struct
    Thumbnail screenshot;
};

code extract from vAmigaWeb emulator see the https://vamigaweb.github.io/doc/about.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions