S
Sk8Kid
Hi, I have an fairly large std::deque<std::string> object, with
about 100,000 or so strings in it. Calling object.clear() freezes
my application for several seconds, which is undesirable. What
is the best way to reclaim deque memory without freezing my app?
I tried deleting the items one at time with a message pump but I
knew that wouldn't work because deque does caching.
while(!deque_object.empty()) {
deque_object.pop_front(); // doesn't reclaim memory
WindowsMessagePump(); // to keep app responsive
}
Is there a way to make sure a call to pop_front() or erase() will
also reduce both the size and the capacity of the deque? I'm using
MSVC 2005.
Thanks
about 100,000 or so strings in it. Calling object.clear() freezes
my application for several seconds, which is undesirable. What
is the best way to reclaim deque memory without freezing my app?
I tried deleting the items one at time with a message pump but I
knew that wouldn't work because deque does caching.
while(!deque_object.empty()) {
deque_object.pop_front(); // doesn't reclaim memory
WindowsMessagePump(); // to keep app responsive
}
Is there a way to make sure a call to pop_front() or erase() will
also reduce both the size and the capacity of the deque? I'm using
MSVC 2005.
Thanks