2 u012122743 u012122743 于 2014.07.15 17:21 提问

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

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

1个回答

u011606457
u011606457   2016.07.01 09:36

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.

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!