MEMALIGNMENT(3)

πŸ“¦ version 15.1, in freebsd 15.1

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
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms