#include <stdalign.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
struct aligned {
uint8_t a;
uint8_t b;
uint8_t c;
};
int
main(void)
{
struct aligned *ptr;
struct aligned alignas(128) stack;
ptr = aligned_alloc(128, sizeof(*ptr));
printf("ptr -> address: %p size: %u \n", ptr
, sizeof(*ptr
)); printf("stack -> address: %p size: %u \n", &stack
, sizeof(stack
)); return 0;
}
I2luY2x1ZGUgPHN0ZGFsaWduLmg+CiNpbmNsdWRlIDxzdGRpbnQuaD4KI2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KCnN0cnVjdCBhbGlnbmVkIHsKCXVpbnQ4X3QgYTsKCXVpbnQ4X3QgYjsKCXVpbnQ4X3QgYzsKfTsKCmludAptYWluKHZvaWQpCnsKCXN0cnVjdCBhbGlnbmVkICpwdHI7CglzdHJ1Y3QgYWxpZ25lZCBhbGlnbmFzKDEyOCkgc3RhY2s7CgoJcHRyID0gYWxpZ25lZF9hbGxvYygxMjgsIHNpemVvZigqcHRyKSk7CglwcmludGYoInB0ciAgIC0+IGFkZHJlc3M6ICVwIHNpemU6ICV1IFxuIiwgcHRyLCBzaXplb2YoKnB0cikpOwoJcHJpbnRmKCJzdGFjayAtPiBhZGRyZXNzOiAlcCBzaXplOiAldSBcbiIsICZzdGFjaywgc2l6ZW9mKHN0YWNrKSk7CglyZXR1cm4gMDsKfQ==