[Bug libstdc++/57440] Memory usage with future and std containers
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue May 28 16:44:00 GMT 2013
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57440
--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
If my guess is right you should be able to reproduce the unbounded memory usage
with this:
#include <future>
int f() { return 0; }
int main()
{
for (int i=0; i < 100000; ++i)
std::async(f).get();
}
And you should not see it happen with this:
#define _GTHREAD_USE_MUTEX_INIT_FUNC
#define _GTHREAD_USE_COND_INIT_FUNC
#include <future>
int f() { return 0; }
int main()
{
for (int i=0; i < 100000; ++i)
std::async(f).get();
}
Please check and update the bug report, thanks.
More information about the Gcc-bugs
mailing list