pub fn align_of(ty: &TypeRef) -> ValueRef
Expand description
Obtain the alignment of the specified type.
§Details
Creates a new constant integer value representing the alignment, in bytes, of a given type.
This function wraps the LLVMAlignOf
function from the LLVM core library, which returns the alignment
of the provided type in bytes as a constant integer value. Alignment is the byte boundary
that the type must adhere to in memory, and understanding it is important for certain
low-level operations.
§Arguments
ty
- A reference to theTypeRef
representing the type whose alignment is being queried.
§Returns
Returns a new constant integer value representing the alignment of the specified type in bytes.