I was wondering if someone can try to implement alignas with mmap by playing with the first parameter? If not, then can anyone try to implement alignas themselves?
Asked
Active
Viewed 43 times
0
-
Using `mmap()` would be a runtime operation. A standard implementation of `_Alignas` is a compile-time operation. Why would you need to implement `_Alignas` rather than using what the compiler provides? – Jonathan Leffler Sep 17 '22 at 16:56
-
1Please give a specific example such as "I want to heap allocate a 5 KB object with 64 byte alignment on x86-64." So far this sounds like an X-Y-I-don't know problem. – John Zwinck Sep 17 '22 at 17:11
-
To do this dynamically, how about `posix_memalign`? – Craig Estey Sep 17 '22 at 17:23