HomeFreeBSD

Replace P2ALIGN with P2ALIGN_TYPED and delete P2ALIGN.

Description

Replace P2ALIGN with P2ALIGN_TYPED and delete P2ALIGN.

In P2ALIGN, the result would be incorrect when align is unsigned
integer and x is larger than max value of the type of align.
In that case, -(align) would be a positive integer, which means
high bits would be zero and finally stay zero after '&' when
align is converted to a larger integer type.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Youzhong Yang <yyang@mathworks.com>
Signed-off-by: Qiuhao Chen <chenqiuhao1997@gmail.com>
Closes #15940

Details

Provenance
chenqiuhao1997 <haohao0924@126.com>Authored on May 10 2024, 3:47 PM
GitHub <noreply@github.com>Committed on May 10 2024, 3:47 PM
Parents
rG1ede0c716bee: libspl_assert: always link -lpthread on FreeBSD
Branches
Unknown
Tags
Unknown