c语言里面的sbrk()函数与malloc()函数的区别

c语言里面的sbrk()函数与malloc()函数的区别有哪些?最近刚看《unix环境高级编程》里面有,不懂,求大神详解,小弟多谢

sbrk requests more memory from the operating system. It is a pretty low-level function and not very flexible.

malloc uses sbrk, but is more flexible. Generally, malloc will ask sbrk for large chunks of memory and then dole out pieces of those large chunks. So most calls to malloc will not result in calls to sbrk.