nginx中内存对齐调用的函数

NAME
posix_memalign - aligned memory allocation ( ADVANCED REALTIME)
SYNOPSIS
[ADV] [Option Start] #include <stdlib.h>

int posix_memalign(void **
memptr, size_t alignment, size_t size); [Option End]

DESCRIPTION

The posix_memalign() function shall allocate size bytes aligned on a boundary specified by alignment, and shall return a pointer to the allocated memory in memptr. The value of alignment shall be a multiple of sizeofvoid *), that is also a power of two. Upon successful completion, the value pointed to by memptr shall be a multiple of alignment.

[CX] [Option Start] The free() function shall deallocate memory that has previously been allocated by posix_memalign(). [Option End]

RETURN VALUE

Upon successful completion, posix_memalign() shall return zero; otherwise, an error number shall be returned to indicate the error.

ERRORS

The posix_memalign() function shall fail if:

[EINVAL]
The value of the alignment parameter is not a power of two multiple of  sizeofvoid *).
[ENOMEM]
There is insufficient memory available with the requested alignment.

The following sections are informative.
EXAMPLES

None.

APPLICATION USAGE

The posix_memalign() function is part of the Advisory Information option and need not be provided on all implementations.

RATIONALE

None.

FUTURE DIRECTIONS

None.

SEE ALSO

free()malloc(), the Base Definitions volume of IEEE Std 1003.1-2001, <stdlib.h>

CHANGE HISTORY

First released in Issue 6. Derived from IEEE Std 1003.1d-1999.

In the SYNOPSIS, the inclusion of <sys/types.h> is no longer required.

End of informative text.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值