sb
来自「Algorithms for Image Processing and Comp」· 代码 · 共 34 行
TXT
34 行
@c ----------------------------------------------------------------------
@node sbrk, memory
@heading @code{sbrk}
@subheading Syntax
@example
#include <osfcn.h>
void *sbrk(int delta)
@end example
@subheading Description
This function changes the "break" of the program by adding @var{delta}
to it. This is the highest address that your program can access without
causing a violation. Since the heap is the region under the break, you
can expand the heap (where @code{malloc} gets memory from) by increasing
the break.
This function is normally accessed only bu @code{malloc} (@pxref{malloc}).
@subheading Return Value
The address of the first byte outside of the valid address range, or -1
if no more memory could be accessed.
@subheading Example
@example
char *buf;
buf = sbrk(1000); /* allocate space */
@end example
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?