Dynamic buffer management question# Programming - 葵花宝典
s*v
1 楼
I'm looking for the best possible solution to this problem:
My class maintains a dynamic buffer that outside callers can write into.
Callers may write in anything with any size. So my buffer has to grow
dynamically. What's the best way to maintain this buffer so that heap
allocation cost is minimized?
Or: a completely different implementation strategy/thinking recommendation
is
also welcome.
Thanks.
My class maintains a dynamic buffer that outside callers can write into.
Callers may write in anything with any size. So my buffer has to grow
dynamically. What's the best way to maintain this buffer so that heap
allocation cost is minimized?
Or: a completely different implementation strategy/thinking recommendation
is
also welcome.
Thanks.