N_A
N_A

Reputation: 19897

object byte alignment in xcode

Is there a way to get the compile-time byte alignment of a class instance in Xcode? In visual studio there is a flag (/d1reportSingleClassLayoutXXX where XXX is the class name) that will dump the class layout to the output window. Is there a similar flag/function in Xcode?

Like this except for using llvm.

Upvotes: 0

Views: 641

Answers (1)

servn
servn

Reputation: 3069

If you need to query the layout of a specific object at compile-time, all of the useful information is available via sizeof(struct X), __alignof(struct X), and offsetof(struct X, member).

References:

__alignof

offsetof

Upvotes: 1

Related Questions