Obstack in glibc

The value of obstack rests upon:
1. It reduces frequency of invoking malloc() and free() system API.
2. You can arbitrarily change the size of object just added to the stack.

How does obstack work?
Namely, obstack is objects in stack, but don't conjecture it with stack very much. Practically, after a new object being added to the stack, the previous objects added in the stack can never be moved or changed.
So you should comprehend the organization of obstack as simple as possible. If you want new memory, that is, for the room of a new object, first resort to the existed pre-allocated block, if rest room in the block caters for the need, just use it, or else malloc a new big block for the need.
  见原出处
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值