hash policy patch
Paolo Carlini
paolo.carlini@oracle.com
Wed Aug 31 09:40:00 GMT 2011
Hi,
> Looks like there is an unexpected bad_alloc exception. The test
> expect one to be generated when the max load factor is set to a very
> small value 0.001 but not in any other place. To do so I used the
> testsuite __gnu_test::set_memory_limits method and I just discover
> that AFAIC see this new test is the first one to use this feature ! It
> is documented this way in testsuite_hooks.h:
>
> // 2) set_memory_limits()
> // set_memory_limits() uses setrlimit() to restrict dynamic memory
> // allocation. We provide a default memory limit if none is passed
> by the
> // calling application. The argument to set_memory_limits() is the
> // limit in megabytes (a floating-point number). If
> _GLIBCXX_RES_LIMITS is
> // not #defined before including this header, then no limiting is
> attempted.
>
> To define _GLIBCXX_RES_LIMITS for the test I use a:
>
> // { dg-options "-std=gnu++0x -D_GLIBCXX_RES_LIMITS" }
>
> But in fact defining _GLIBCXX_RES_LIMITS when including this
> header is not enough and is even rather useless. This macro is also
> used in testsuite_hooks.cc so it must be defined when this translation
> unit is built. So could you try to run the test again with this command:
>
> make CXXFLAGS=-D_GLIBCXX_RES_LIMITS check
Actually, I don't think this is the way to go, I'm sorry to not have
noticed that earlier. Normally, see, eg, locale/cons/12438.cc, we just
call __gnu_test::set_memory_limits, I blindly assumed you followed the
existing practice.
I can try to run the patch + testcases with the -D_GLIBCXX_RES_LIMITS
removed, but please, in general, be careful to allow for a range of
different system, we can't be too strict, generically.
Paolo.
More information about the Libstdc++
mailing list