MEMALIGNMENT(3)
okay so bestie, welcome to MEMALIGNMENT(3) from the Library Functions Manual π this is the libc function that checks how aligned a pointer is, and itβs giving tiny detective energy πβ¨
π NAME π
memalignment β find the memory alignment of an object
β¨ SYNOPSIS β¨
Standard C Library (libc, -lc) #include <stdlib.h>
size_t
memalignment(const void *ptr);
π DESCRIPTION π
Okay so memalignment() determines the alignment of the object pointed to by ptr. This alignment is a power of 2, and it may be larger than the range supported by the alignof operator. The value returned can be compared to the result of alignof, and if it is greater or equal, the alignment requirement of the operand is satisfied.
π«Ά RETURN VALUES π«Ά
It returns the alignment of ptr as a power of 2. If ptr is a null pointer, an alignment of zero is returned. An alignment of zero indicates that the tested pointer cannot be used to access an object of any type.
zero alignment is the βnope, cannot use this pointer for any object typeβ vibe check π
π SEE ALSO π
β STANDARDS β
The memalignment() function conforms to .
yes bestie, that is literally the whole standard sentence β just a dot, no cap π«
π HISTORY π
The memalignment() function was added in FreeBSD 15.1.
π AUTHOR π
Robert Clausecker <fuz@FreeBSD.org>
mwah π this page comes from Debian, dated November 10, 2025, and itβs serving MEMALIGNMENT(3) realness. periodt π
π¦ where this page comes from
- freebsd 15.1: base 15.1
- π the page's license: BSD-2-Clause
- Copyright (c) 2025 Robert Clausecker <fuz@FreeBSD.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms