summaryrefslogtreecommitdiff
path: root/indra/llcommon/llinstancetracker.h
AgeCommit message (Collapse)Author
2017-05-08DRTVWR-418: Work around VS2013's lack of __has_feature().Nat Goodspeed
2017-05-08DRTVWR-418: Fix -std=c++11 llinstancetracker_test crash.Nat Goodspeed
LLInstanceTracker<T> performs validation in ~LLInstanceTracker(). Normally validation failure logs an error and terminates the program, which is fine. In the test executable, though, we want validation failure to throw an exception instead so we can catch it and continue testing other failure conditions. But since destructors in C++11 are implicitly noexcept(true), that exception never made it out of ~LLInstanceTracker(): it crashed the test program instead. Declaring ~LLInstanceTracker() noexcept(false) solves that, allowing the test program to catch the exception and continue. However, if we unconditionally declare that, then every destructor anywhere in the inheritance hierarchy for any LLInstanceTracker subclass must also be noexcept(false)! That's way too pervasive, especially for functionality we only need (or want) in a specific test executable. Instead, make the CMake macros LL_ADD_PROJECT_UNIT_TESTS() and LL_ADD_INTEGRATION_TEST() -- with which we define all viewer build-time tests -- define two new command-line macros: LL_TEST=testname and LL_TEST_testname. That way, preprocessor logic in a header file can detect whether it's being compiled for production code or for a test executable. (While at it, encapsulate in a new GET_OPT_SOURCE_FILE_PROPERTY() CMake macro an ugly repetitive pattern. The builtin GET_SOURCE_FILE_PROPERTY() sets the target variable to "NOTFOUND" -- rather than an empty string -- if the specified property wasn't set. Every call to GET_SOURCE_FILE_PROPERTY() in LL_ADD_PROJECT_UNIT_TESTS() was followed by a test for NOTFOUND and an assignment to "". Wrap all that in a macro whose 'unset' value is "".) Now llinstancetracker.h can detect when we're building the LLInstanceTracker unit test executable, and *only then* declare ~LLInstanceTracker() as noexcept(false). We #define LLINSTANCETRACKER_DTOR_NOEXCEPT to expand either empty or noexcept(false), also detecting clang in C++11 mode. (It all works fine without noexcept(false) until we turn on C++11 mode.) We also use that macro for the StatBase class in lltrace.h. Turns out some of the infrastructure headers required for tests in general, including the LLInstanceTracker test, use LLInstanceTracker. Fortunately that appears to be the only other class we must annotate this way for the LLInstanceTracker tests.
2015-11-10remove execute permission from many files that should not have itOz Linden
2013-11-20SH-4626 FIX: [INTERESTING RC] Viewer randomly crashes when I click on links ↵Richard Linden
in IMs or group IMs
2013-11-19SH-4634 FIX Interesting: Viewer crashes when receiving teleport offerRichard Linden
renamed fast timers to have unique names, changes instance tracker to never allow duplicates
2013-10-24SH-4577 WIP Interesting: viewer crashed when clicking a offline Conversation ↵Richard Linden
containing a shared object potential fix by making instance tracker allow key collisions for LLToastNotifyPanel changed assertion macro to use original unpreprocessed source code renamed instance tracker behavior macros to use LL prefix added RestoreCameraPosOnLogin setting to optionally restore old camera positioning behavior
2013-10-17fix for assert at runtime (reading stats from recording while it was active)Richard Linden
fix for bad values returns from getPeriodMin and getPeriodMax on count stats when no counts recorded fix for gcc compile time error (typename ftw)
2013-10-17moved root timer to global variableRichard Linden
added flag to LLInstanceTracker to allow multiple values per key made StatType allow multiple values per key to eliminate block timer related crash
2013-10-08merge from viewer-releaseRichard Linden
2013-08-26Tweak MAINT-3046 fix for faster remove_() performancesimon
2013-08-23MAINT-3046 make LLNotifications clear out vecs of LLNotificationChannelPtr ↵Graham Madarasz (Graham Linden)
so singleton cleanup doesn't do things it really ought not do
2013-07-30Summer cleaning - removed a lot of llcommon dependencies to speed up build timesRichard Linden
consolidated most indra-specific constants in llcommon under indra_constants.h fixed issues with operations on mixed unit types (implicit and explicit) made LL_INFOS() style macros variadic in order to subsume other logging methods such as ll_infos added optional tag output to error recorders
2013-07-18SH-4297 WIP interesting: viewer-interesting starts loading cached scene lateRichard Linden
dependency cleanup - removed a lot of unecessary includes
2013-06-05merge with viewer-releaseRichard Linden
2013-05-09Merge downstream code and viewer-betasimon
2013-04-24diff -r 59c7bed66dfd indra/llcommon/lleventapi.hsimon
2013-04-21SH-3931 WIP Interesting: Add graphs to visualize scene load metricsRichard Linden
added ExtendablePeriodicRecording and ability to append periodic recordings to each other
2013-04-19SH-4080 WIP interesting: random crash on MacRichard Linden
removed unused dll support from llinstancetracker as it didn't appear to be thread safe
2013-04-17Some minor cleanups while hunting crashes. Reviewed by Kellysimon
2013-03-29Update Mac and Windows breakpad builds to latestGraham Madarasz
2013-03-19Merge in viewer-beta to get CHUI codeSimon Linden
2013-03-01Added missing enums for integ test usageGraham Madarasz (Graham)
2013-02-28Modify LLInstanceTracker to avoid using a map of strings to find a map of ↵Graham Madarasz (Graham)
foo to find some pointers
2012-12-23SH-3468 WIP add memory tracking base classRichard Linden
fixed crash on exit by making LLInstanceTracker iterators use atomic iterator nesting count for thread safety
2012-11-01SH-3405 FIX convert existing stats to lltrace systemRichard Linden
final removal of remaining LLStat code
2012-07-27Pull and merge from ssh://hg@bitbucket.org/lindenlab/viewer-release.Todd Stinson
2012-02-27Make LLInstanceTracker<T, T*>::getInstance(T*) validate passed T*.Nat Goodspeed
For the T* specialization (no string, or whatever, key), the original getInstance() method simply returned the passed-in T* value. It was defined, as the comments noted, for completeness of the analogy with the keyed LLInstanceTracker specialization. It turns out, though, that getInstance(T*) can still be useful to ask whether the T* you have in hand still references a valid T instance. Support that usage.
2012-03-29CHUI-51 WIP notifications routig code cleanupRichard Linden
phase 2, removal of extraneous signaling in favor of llnotificationchannels made notificationchannels work better with overrides and lifetime managed by creator
2011-10-17fixed one crash on exitRichard Nelson
2011-09-07STORM-1541: Change llassert() to llassert_always(): unit tests expect.Nat Goodspeed
Now that we have unit tests that require assertion failure if you try to delete an LLInstanceTracker subclass instance with an iterator loose, having llassert() "sometimes" compile away (whimsically, depending on platform as well as build type!) makes those tests fail. Use llassert_always() instead.
2011-09-06STORM-1541: Hoist LLInstanceTracker::getMap_() to base getStatic().Nat Goodspeed
Generalize the notion of getting some chunk of "static" storage: introduce LLInstanceTrackerBase::getStatic() template method. Define StaticData struct containing the InstanceMap (or InstanceSet, for that specialization) along with the S32 that caused the VS2010 linker so much grief. Completely eliminate that S32 as an actual class-static member, qualifying all references with the struct returned by getStatic(). In LLInstanceTrackerBase::getInstances(), use one std::map lookup instead of three.
2011-08-24Re-add 3 llinstancetracker tests disabled by changeset 1ead63777bf6.Nat Goodspeed
Fix LLInstanceTracker::key_iter constructor param; accepting InstanceMap::iterator by non-const reference relied on Microsoft extension that accepts non-const reference to an rvalue. Given typical iterator implementation, simply accept by value instead, which makes gcc happy too.
2011-07-27Swap typename and const.Aaron Stone
2011-07-27another potential gcc fixRichard Nelson
2011-07-27broken operator= semantics for instance tracker iteratorsRichard Nelson
2011-07-27 another fix for buildRichard Nelson
2011-07-26fixed buildRichard Nelson
2011-07-26removed last vestiges of llinstancetracerscopedguardRichard Nelson
2011-07-26EXP-1021 FIX Position of web content browser dictates position of profile ↵Richard Nelson
panel - profile panel position changes do not persist EXP-1030 FIX Search button toggle can get out of synch in bottom bar made llinstancetracker::iterator do own nested level management (removing need for separate guard) added support for filename= to floaters can pass in arbitrary window_class to floaters
2011-03-09Fix for "doubleton" error using LLInstanceTracker across shared library ↵brad kittenbrink
boundaries.
2010-08-13Change license from GPL to LGPL (version 2.1)Oz Linden
2010-02-06EXT-5055 LLInstanceTracker promotes some dangerous patterns - detect themTofu Linden
2009-11-11Rename private methods to avoid ambiguity with subclassesNat Goodspeed
2009-11-10Enhance LLInstanceTracker variants to be more uniform.Nat Goodspeed
For both the (so far unused) generic KEY form and the KEY = T* form, provide key_iter, beginKeys(), endKeys(). Change instance_iter so that when dereferenced, it gives you a T& rather than a T*, to be more harmonious with a typical STL container. (You parameterize LLInstanceTracker with T, not with T*.) Fix existing usage in llfasttimer.cpp and lltimer.cpp to agree. For the KEY = T* specialization, add T* getInstance(T*) so client isn't forced to know which variant was used. Add unit tests for uniformity of public operations on both variants.
2009-10-16svn revert -r136312 llinstancetracker.h - reverted changed to instance ↵Richard Nelson
tracker that won't work with llcommon.dll
2009-10-14fixed a bug in LLFastTimer data gathering, and made them even faster (122 ↵Richard Nelson
cycles on my 2.5Ghz Xeon) can call LLFastTimer::nextFrame with timers still on the stack...first step towards more flexible data gathering LLInstanceTracker works with statically allocated instances now reviewed by Brad
2009-06-21merge -r 122421-124917 viewer-2.0.0-2 -> viewer-2.0.0-3Steven Bennetts
ignore-dead-branch