In nearly all versions of Unix, SBRK can be used with negative arguments to achieve this effect.
在几乎所有的UNIX版本中,sbrk可以使用负参数达到这个效果。
Because SBRK may give back more memory than we ask for, we leak some memory at the end of the heap.
由于sbrk可能会交回比我们请求的更多的内存,所以在堆(heap)的末端会遗漏一些内存。
SBRK moves the current system break by the number of bytes in its argument, and then returns the new system break.
sbrk根据参数中给出的字节数移动当前系统中断点,然后返回新的系统中断点。
Because it is at the border, it is the only chunk that can be arbitrarily extended (via sbrk in Unix) to be bigger than it is (unless of course sbrk fails because all memory has been exhausted).
因为它在边界处,它是唯一一个可以任意的扩展(通过Unix的sbrk系统调用)成更大的块(除非因为所有的内存已经被消耗光了导致sbrk失败)。
Because it is at the border, it is the only chunk that can be arbitrarily extended (via sbrk in Unix) to be bigger than it is (unless of course sbrk fails because all memory has been exhausted).
因为它在边界处,它是唯一一个可以任意的扩展(通过Unix的sbrk系统调用)成更大的块(除非因为所有的内存已经被消耗光了导致sbrk失败)。
应用推荐