librelist archives

« back to archive

Questions about expensive packet put

Questions about expensive packet put

From:
=?ks_c_5601-1987?B?x+O9xb+1?=
Date:
2014-08-11 @ 09:45
Hello,

I tested to make a Packet instance having big size data.
At first, I created Packet.
pk = Packet::make(100, NULL, total_buf_size, 100).

Then, I put additional space in the buffer.
pk->put(1024);

However, following warning still came out.
expensive Packet::put; have 0 wanted 1024

I changed total_buf_size but it was ineffective.
Only I set the tailroom size to 1024 was no warnings.

What is the safe way to put space in the packet?
Should I create WritablePacket instance with enough tailroom size in the 
first place?

Thanks.
Cinyoung.