| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change speeds up the simple benchmark below by about 40%.
struct A { virtual ~A() {} };
struct B: A { } b;
A* ap = &b;
void *sink;
int main()
{
for (long i = 0; i < 4000000000L; ++i)
sink = dynamic_cast<B*>(ap);
}
libstdc++-v3/ChangeLog:
* libsupc++/dyncast.cc (__dynamic_cast): Avoid virtual function
call in simple success case.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
The null pointer check is never needed for correct code, only to
gracefully handle undefined cases. Add __builtin_expect to be sure that
we don't pessimize the valid uses.
libstdc++-v3/ChangeLog:
* libsupc++/dyncast.cc (__dynamic_cast): Add __builtin_expect to
precondition check.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
libstdc++-v3/ChangeLog:
PR c++/99074
* libsupc++/dyncast.cc (__dynamic_cast): Return null when
first argument is null.
gcc/testsuite/ChangeLog:
PR c++/99074
* g++.dg/warn/Wnonnull11.C: New test.
|
| |
|
|
|
|
|
|
|
|
|
| |
Although the code here is well formed, it doesn't show intent well.
The reason checkers trigger on this is that it is a cause of real
bugs. So, negate a ptrdiff_t instead.
* libsupc++/dyncast.cc (__dynamic_cast): Cast offsetof to
ptrdiff_t before negation, to show intent more clearly.
|
|
|
|
| |
From-SVN: r279813
|
|
|
|
| |
From-SVN: r267494
|
|
|
|
| |
From-SVN: r256169
|
|
|
|
| |
From-SVN: r243994
|
|
|
|
| |
From-SVN: r232055
|
|
|
|
| |
From-SVN: r219188
|
|
|
|
|
|
|
|
|
| |
gracefully.
* libsupc++/dyncast.cc (__dynamic_cast): Handle mid-destruction
dynamic_cast more gracefully.
From-SVN: r215350
|
|
|
|
| |
From-SVN: r206301
|
|
|
|
| |
From-SVN: r195701
|
|
|
|
|
|
|
|
|
| |
bases that don't overlap the desired address.
* libsupc++/vmi_class_type_info.cc (__do_dyncast): Use src2dst hint
to defer searching bases that don't overlap the desired address.
From-SVN: r149297
|
|
|
|
| |
From-SVN: r145841
|
|
* libsupc++/array_type_info.cc: Likewise.
* libsupc++/bad_cast.cc: Likewise.
* libsupc++/bad_typeid.cc: Likewise.
* libsupc++/class_type_info.cc: Likewise.
* libsupc++/dyncast.cc: Likewise.
* libsupc++/enum_type_info.cc: Likewise.
* libsupc++/function_type_info.cc: Likewise.
* libsupc++/fundamental_type_info.cc: Likewise.
* libsupc++/pbase_type_info.cc: Likewise.
* libsupc++/pmem_type_info.cc: Likewise.
* libsupc++/pointer_type_info.cc: Likewise.
* libsupc++/si_class_type_info.cc: Likewise.
* libsupc++/vmi_class_type_info.cc: Likewise.
* libsupc++/tinfo.h: Move inline type_info functions here.
* libsupc++/tinfo.cc: Separate type_info classes into their own
files.
* libsupc++/tinfo2.cc: Likewise.
* Makefile.am (sources): Mention new files.
* Makefile.in: Regenerated.
From-SVN: r123042
|