Commit Graph

29 Commits (557fb2cccdb8f267c38f0b2dc88ce939bf1ccc21)

Author SHA1 Message Date
Andrey Kleshchev 0d7f6d917a SL-13729 Performance of LLUI and LLRender2D #3 2020-09-18 17:27:12 +03:00
Andrey Kleshchev a5c8b1cbe2 SL-13729 Performance of LLUI and LLRender2D #2 2020-09-17 20:39:45 +03:00
Nat Goodspeed 9d5b897600 DRTVWR-494: Defend LLInstanceTracker against multi-thread usage.
The previous implementation went to some effort to crash if anyone attempted
to create or destroy an LLInstanceTracker subclass instance during traversal.
That restriction is manageable within a single thread, but becomes unworkable
if it's possible that a given subclass might be used on more than one thread.

Remove LLInstanceTracker::instance_iter, beginInstances(), endInstances(),
also key_iter, beginKeys() and endKeys(). Instead, introduce key_snapshot()
and instance_snapshot(), the only means of iterating over LLInstanceTracker
instances. (These are intended to resemble functions, but in fact the current
implementation simply presents the classes.) Iterating over a captured
snapshot defends against container modifications during traversal. The term
'snapshot' reminds the coder that a new instance created during traversal will
not be considered. To defend against instance deletion during traversal, a
snapshot stores std::weak_ptrs which it lazily dereferences, skipping on the
fly any that have expired.

Dereferencing instance_snapshot::iterator gets you a reference rather than a
pointer. Because some use cases want to delete all existing instances, add an
instance_snapshot::deleteAll() method that extracts the pointer. Those cases
used to require explicitly copying instance pointers into a separate
container; instance_snapshot() now takes care of that. It remains the caller's
responsibility to ensure that all instances of that LLInstanceTracker subclass
were allocated on the heap.

Replace unkeyed static LLInstanceTracker::getInstance(T*) -- which returned
nullptr if that instance had been destroyed -- with new getWeak() method
returning std::weak_ptr<T>. Caller must detect expiration of that weak_ptr.

Adjust tests accordingly.

Use of std::weak_ptr to detect expired instances requires engaging
std::shared_ptr in the constructor. We now store shared_ptrs in the static
containers (std::map for keyed, std::set for unkeyed).

Make LLInstanceTrackerBase a template parameterized on the type of the static
data it manages. For that reason, hoist static data class declarations out of
the class definitions to an LLInstanceTrackerStuff namespace.

Remove the static atomic sIterationNestDepth and its methods incrementDepth(),
decrementDepth() and getDepth(), since they were used only to forbid creation
and destruction during traversal.

Add a std::mutex to static data. Introduce an internal LockStatic class that
locks the mutex while providing a pointer to static data, making that the only
way to access the static data.

The LLINSTANCETRACKER_DTOR_NOEXCEPT macro goes away because we no longer
expect ~LLInstanceTracker() to throw an exception in test programs.
That affects LLTrace::StatBase as well as LLInstanceTracker itself.

Adapt consumers to the new LLInstanceTracker API.
2020-03-25 15:28:17 -04:00
andreykproductengine c61d0f4297 DRTVWR-493 LLUI to LLParamSingleton 2019-08-10 15:31:03 +03:00
Oz Linden c8726aba30 remove execute permission from many files that should not have it 2015-11-10 09:48:56 -05:00
callum_linden 7359e9300a Update to build on Xcode 6.0: collection of removal of unused const variables [-Wunused-const-variable] 2014-10-17 16:52:32 -07:00
simon ee2fce8790 Merge downstream code and viewer-beta 2013-05-09 14:10:45 -07:00
Oz Linden ddd5659f81 merge changes for DRTVWR-294 2013-04-19 10:11:29 -04:00
Graham Madarasz bf6182daa8 Update Mac and Windows breakpad builds to latest 2013-03-29 07:50:08 -07:00
Graham Madarasz e8b8a12b73 Mods to make compile on gcc 4.6.3 work mo betta 2013-03-12 10:48:05 -07:00
Don Kjer c06c35609c Updating linux build to gcc4.6 2012-10-11 00:09:04 +00:00
Richard Nelson fd9f3b9fe9 EXP-1021 FIX Position of web content browser dictates position of profile 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-07-26 14:26:27 -07:00
Jonathan Yap e2a531791e STORM-1334 Console debug data scrolls away too quickly and is hard to read 2011-06-15 07:02:28 -04:00
Oz Linden 06b0d72efa Change license from GPL to LGPL (version 2.1) 2010-08-13 07:24:57 -04:00
Palmer e938d055f4 EXT-5309 : prevent infinite loop in LLConsole. Reviewed by Richard 2010-02-17 17:06:36 -08:00
richard 6961a1501f build fix 2010-02-10 18:40:15 -08:00
richard 8bc4dcc855 EXT-5321 - llinfos from non ui threads is not thread safe
reviewed by Mani
2010-02-10 18:13:02 -08:00
Tofu Linden 5c01eca7dd CID-345
Checker: UNINIT_CTOR
Function: LLConsole::LLConsole(const LLConsole::Params &)
File: /indra/llui/llconsole.cpp
2010-01-29 13:18:29 -08:00
James Cook 9ffaacc47e First pass expose inventory item settings in XML (folder_view_item.xml)
Optimized LLFolderViewItem constructor by passing param block as
const ref to avoid copies.
Removed per-item arrow and background images, use defaults.
Removed unneeded static image pointers.
Removed hard-coded rounded_square.tga, replaced with Rounded_Square
Ditto for folder_arrow.tga
Reviewed with Richard.
2010-01-08 17:26:47 -08:00
richard a1e342b3f7 merge 2010-01-06 12:40:44 -08:00
richard 4966073030 moved clipping logic inside LLFontGL::maxDrawableChars controlled by EWordWrapStyle
fixes regression introduced in 3eef5ce9ae1e6fc62b9b52ce859501dd4e70fadf

reviewed by Brad
2010-01-06 12:23:56 -08:00
richard 1bbd259f2d EXT-3878 - Menus disappear when UI Size is < 1.00
EXT-3647 - Auto-scrolling of IMs should resume when user types in chat
EXT-3877 - Pinning two levels of menus prevents movement using arrow keys
EXT-1303 - Hyperlink text wraps in the middle of a word

reviewed by James
2010-01-06 11:17:38 -08:00
Tofu Linden 43cdebefa6 EXT-3318 LLConsole keeps all logged text in memory when console is not being drawn. 2010-01-04 14:03:02 -08:00
Bryan O'Sullivan de78ec1345 Nuke the last few references to the long-dead LCD code. 2009-11-24 15:31:34 -08:00
richard 4eb72a12a2 data driven layout of top-level UI elements
EXT-1219 Side tray slide-out animation
cleaned up some layout of bottom tray contents

reviewed by James
2009-11-09 15:29:47 -08:00
Steve Bennetts 590d3b9e3a EXT-1279 Crash if font file not found.
Added getFontDefault() to llfontgl.h

--HG--
branch : branch-test
2009-10-15 14:14:46 -07:00
James Cook ada0f4fa22 Merge inspectors UI project, gooey-4, into viewer-2 trunk. Added new tooltips to 3D avatars, 2D avatar names, and 3D objects. Refactors tooltips and text boxes, line editors, and text editors. Breaks LLExpandableTextBox, but a fix is coming.
Resolved conflicts in lltexteditor.cpp, llchatitemscontainerctrl.cpp, llchatmsgbox.cpp, llfloaterbuycurrency.cpp, llnearbychat.cpp, floater_buy_currency.xml, and ru/strings.xml

Merging revisions 134925-135157 of svn+ssh://svn.lindenlab.com/svn/linden/branches/gooey/gooey-4 into C:\source\viewer-2.0.0-3, respecting ancestry
2009-10-03 23:40:28 +00:00
James Cook d6101558a1 Merge xui-army-5 to viewer-2, includes layout, art, and color changes, also UI color refactoring and new FreeType font library on Linux.
svn merge -r126038:126164 svn+ssh://svn.lindenlab.com/svn/linden/branches/skinning/xui-army-5
2009-07-06 21:58:04 +00:00
Steven Bennetts 9ec432034d merge -r 122421-124917 viewer-2.0.0-2 -> viewer-2.0.0-3
ignore-dead-branch
2009-06-21 08:04:56 +00:00