I'll try to come up with a sample tomorrow, but the surrounding code is pretty complex, so I'm not 100% sure it will still exhibit the same pattern if I do the same thing in a stripped application.
As an alternative to not clearing the items before I put them back in the list, would there be any problem with storing my own list of buffers internally, and then calling AddAllocated() a bunch of times while building the message stream and then ReleaseLast() at the end until all the messages are clear? What I really want is a way to just give it a raw memory buffer, tell it how big the buffer is, and then have it just store a pointer to the buffer. Then there's no strings, no copying, etc. It's currently somewhat awkard, because my sequence goes like this:
1) Read some data from the disk into a buffer
2) Put that data into a proto buf message.
3) Repeat this a number of times, putting each chunk of data into a new message
4) Serialize the new message, which contains a list of chunks into an array.
5) Call socket.write() with the serialized array.
But that's 3 copies. There's my original buffer that i read from the disk into, protobuf's message buffer where it stores internally as a string, and the final buffer that I serialize into so that I can send it across the wire. It would be nice if I could get rid of all this copying.