Files
freebsd/lib/libc/stdlib/memalignment.3
T
Alexander Ziaee 82c013fb59 manuals: Fix more Fx and nearby mechanical typos
Fix compiler warnings related to the Fx macro, as well as all other
mechanical typos that were visible within one screenful of them. These
cause rendering glitches on various toolchains with various of the five
and a half decades of rich output formats and tooling manpages scale to.

The *x macro set specifies operating systems. These macros take the rest
of the line as an argument. Sometimes, a space was not used to separate
the argument of Fx and the trailing period. Others had other parts of
the sentence supplied as an argument to Fx.

While here, fix the other mechanical typos visible on those specific
screenfulls. Correct section typo AUTHOR to AUTHORS, markup utilities
with Sy, and apply line break after the end of a sentence.

PR:		297248
MFC after:	3 days
Reported by:	wosch (are you sure that's all of the broken Fx'es?)
Fixes:		ff2bc64159 ("Fix Fx and nearby mechanical typos")
Fixes:          d790b16bbf ("add man pages for stdbit functions")
Fixes:		6c57e368eb ("implement C23 memalignment()")
Fixes:		b06338167d ("ROUTE_MPATH and FIB_ALGO")
Fixes:		7e1affa242 ("revise divert-to and divert-reply")
2026-08-04 10:04:23 -04:00

54 lines
1.1 KiB
Plaintext

.\"
.\" Copyright (c) 2025 Robert Clausecker <[email protected]>
.\"
.\" SPDX-License-Identifier: BSD-2-Clause
.\"
.Dd November 10, 2025
.Dt MEMALIGNMENT 3
.Os
.Sh NAME
.Nm memalignment
.Nd find the memory alignment of an object
.Sh SYNOPSIS
.Lb libc
.In stdlib.h
.Ft size_t
.Fn memalignment "const void *ptr"
.Sh DESCRIPTION
The
.Fn memalignment
function determines the alignment of the object pointed to by
.Fa ptr .
This alignment is a power of\~2, and may be larger than the range
supported by the
.Sy alignof
operator.
The value returned can be compared to the result of
.Sy alignof ,
and if it is greater or equal, the alignment requirement of the operand
is satisfied.
.Sh RETURN VALUES
Returns the alignment of
.Fa ptr
as a power of\~2.
If
.Fa 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.
.Sh SEE ALSO
.Xr aligned_alloc 3 ,
.Xr posix_memalign 3
.Sh STANDARDS
The
.Fn memalignment
function conforms to
.St -isoC-2023 .
.Sh HISTORY
The
.Fn memalignment
function was added in
.Fx 15.1 .
.Sh AUTHORS
.An Robert Clausecker Aq Mt [email protected]