
Practically vectorstream is associated with "information packet". It should firstly to allocate memory with some maximum size (to send/receive through socket or shmem). So it seems no matter what "resize" or "reserve" will used. Ion GaztaƱaga wrote:
Hi Dmitry,
"vectorstream" has "reserve" function instead of "resize" function like in documentation and previous versions :-)
Ooops. Documentation is not up-to-date. Resize was changed with reserve because
a) I originally wanted to reserve memory, but not add characters to the stream. Shmem version called resize and set the new streams pointers, but this was not correct.
b) I thought that adding characters to be stream should be done using stream functions, instead of though a vector resize.
The idea in Interprocess is to have "reserve" to avoid reallocations when inserting new characters in the vector and I don't plan to include "reserve". Do you see it useful?
Regards,
Ion