extern"C" { int __cxa_atexit(void (*func)(void*), void* arg, void* dso);
// TODO(b/175635923). __cxa_finalize's return type should actually be "void", // but it is declared "int" here instead to be compatible with the declaration // in an old version of cxxabi.h, which is included indirectly. The declarations // of __cxa_atexit and __cxa_finalize are removed from newer versions of // cxxabi.h, so once libc++ is updated, this return type should be changed to // "void". int __cxa_finalize(void* dso);
}
for (int i = 0; i < 500; ++i) {
__cxa_atexit(append_to_actual, newint{i}, &handles[i % 2]);
}
__cxa_finalize(&handles[0]);
for (int i = 500; i < 750; ++i) {
__cxa_atexit(append_to_actual, newint{i}, &handles[1]);
}
__cxa_finalize(&handles[1]);
std::vector<int> expected; for (int i = 498; i >= 0; i -= 2) expected.push_back(i); for (int i = 749; i >= 500; --i) expected.push_back(i); for (int i = 499; i >= 1; i -= 2) expected.push_back(i);
ASSERT_EQ(expected.size(), actual.size()); for (size_t i = 0; i < expected.size(); ++i) {
ASSERT_EQ(expected[i], actual[i]) << "index=" << i;
}
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.1 Sekunden
(vorverarbeitet am 2026-06-28)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.