Skip to content

Instantly share code, notes, and snippets.

@manishym
Created September 17, 2023 07:36
Show Gist options
  • Save manishym/0f1be3d95db928c8e2b3fc8fea86b7d3 to your computer and use it in GitHub Desktop.
Save manishym/0f1be3d95db928c8e2b3fc8fea86b7d3 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <stdint.h>
struct foo
{
char b;
__int128_t bar;
char baz;
__int128_t barz;
char barzz;
};
struct var4_aligned
{
char a;
int b;
char c;
};
struct var8_aligned
{
char a;
int64_t b;
char c;
};
struct var16_aligned
{
char a;
__int128_t b;
char c;
};
struct var16_aligned_member80
{
char a;
struct foo b;
char c;
};
struct var
{
char a;
volatile struct foo b;
char c;
};
int main()
{
printf("Size of var: %ld, foo: %ld\n", sizeof(struct var), sizeof(struct foo));
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment