Thursday 15 July 2010

Explicitly free memory underlying C++ iostream -


I am writing a C ++ application that provides large amounts of binary data (10 M +) deposits and dyes To use an iostream frequency. The stream is preferred for many reasons, but the most important of these is the ease of integration with the third-party stream-based API, without the need for any kind of memory copies.

When I am used to digest the data, I would like to clear the iostream example the underlying memory. I am sure that when the example goes out of the scope the memory will be released, but since I am passing it in API, I'm not sure that it will be handled efficiently. If I was using a stringstream, I can call std :: stringstream.clear (); Std :: stringstream.str (std :: string ()); . Is iostream 'reset' clearly a similar way?

Thanks in advance.

solution is to use a std :: stringstream std :: iostream objects are summarized for temptation.

No comments:

Post a Comment