Age | Commit message (Collapse) | Author |
|
|
|
The previous LLSafeHandle<T> implementation declares a static data member of
the template class but provides no (generic) definition, relying on particular
specializations to provide the definition. The data member is a function
pointer, which is called in one of the methods to produce a pointer to a
"null" T instance: that is, a dummy instance to be dereferenced in case the
wrapped T* is null.
Xcode 8.3's version of clang is bothered by the call, in a generic method,
through this (usually) uninitialized pointer. It happens that the only
specializations of LLSafeHandle do both provide definitions. I don't know
whether that's formally valid C++03 or not; but I agree with the compiler: I
don't like it.
Instead of declaring a public static function pointer which each
specialization is required to define, add a protected static method to the
template class. This protected static method simply returns a pointer to a
function-static T instance. This is functionally similar to a static
LLPointer<T> set on demand (as in the two specializations), including lazy
instantiation.
Unlike the previous implementation, this approach prohibits a given
specialization from customizing the "null" instance function. Although there
exist reasonable ways to support that (e.g. a related traits template), I
decided not to complicate the LLSafeHandle implementation to make it more
generally useful. I don't really approve of LLSafeHandle, and don't want to
see it proliferate. It's not clear that unconditionally dereferencing
LLSafeHandle<T> is in any way better than conditionally dereferencing
LLPointer<T>. It doesn't even skip the runtime conditional test; it simply
obscures it. (There exist hints in the code that at one time it might have
immediately replaced any wrapped null pointer value with the pointer to the
"null" instance, obviating the test at dereference time, but this is not the
current functionality. Perhaps it was only ever wishful thinking.)
Remove the corresponding functions and static LLPointers from the two classes
that use LLSafeHandle.
|
|
When a 'family' code isn't recognized, for instance, report the family code.
That should at least clue us in to look up and add an entry for the relevant
family code.
|
|
LLEventPump's destructor was using LLEventPumps::instance() to unregister the
LLEventPump instance from LLEventPumps. Evidently, though, there are lingering
LLEventPump instances that persist even after the LLSingletonBase::deleteAll()
call destroys the LLEventPumps LLSingleton instance. These were resurrecting
LLEventPumps -- pointlessly, since a newly-resurrected LLEventPumps instance
can have no knowledge of the LLEventPump instance! Unregistering is
unnecessary!
What we want is a reference we can bind into each LLEventPump instance that
allows us to safely test whether the LLEventPumps instance still exists.
LLHandle is exactly that. Make LLEventPumps an LLHandleProvider and bind its
LLHandle in each LLEventPump's constructor; then the destructor can unregister
only when LLEventPumps still exists.
|
|
Apparently we've been getting away so far without this essential #include only
by "leakage" from other #includes in existing consumers. <eyeroll/>
|
|
The logging subsystem depends on two different LLSingletons for some reason.
It turns out to be very difficult to completely avoid executing any logging
calls after the LLSingletonBase::deleteAll(), but we really don't want to
resurrect those LLSingletons so late in the run for a couple stragglers.
Introduce LLSingleton::wasDeleted() query method, and use it in logging
subsystem to simply bypass last-millisecond logging requests.
|
|
|
|
|
|
clang has started to reject our non-const comparison operator methods used
within standard algorithms.
|
|
|
|
The present CMake logic wants to pass FIXED:NO to the linker for 64-bit
builds, which on the face of it seems like a Good Thing: it permits code to be
relocated in memory, preventing collisions if two libraries happen to want to
load into overlapping address ranges.
However the way it's being specified is wrong and harmful. Passing /FIXED:NO
to the compiler command line engages /FI (Forced Include!) of a nonexistent
file XED:NO -- producing lots of baffling fatal compile errors.
Thanks Callum for diagnosing this!
|
|
|
|
|
|
|
|
Some day llmake() will be unnecessary because compiler deduction of class
template arguments from constructor arguments has been approved by ISO.
|
|
LLPrivateMemoryPool and LLPrivateMemoryPoolManager have assumed that it's
always valid to cast a pointer to U32. With 64-bit pointers, no longer true.
|
|
with tests on ADDRESS_SIZE, which is now set on the compiler command line.
|
|
|
|
|
|
|
|
autobuild 1.1 now supports expanding $variables within a config file --
support that was explicitly added to address this very problem. So now the
windows platform in autobuild.xml uses $AUTOBUILD_ADDRSIZE,
$AUTOBUILD_WIN_VSPLATFORM and $AUTOBUILD_WIN_CMAKE_GEN, which should handle
most of the deltas between the windows platform and windows64.
This permits removing the windows64 platform definition from autobuild.xml.
The one remaining delta between the windows64 and windows platform definitions
was -DLL_64BIT_BUILD=TRUE. But we can handle that instead by checking
ADDRESS_SIZE. Change all existing references to WORD_SIZE to ADDRESS_SIZE
instead, and set ADDRESS_SIZE to $AUTOBUILD_ADDRSIZE. Change the one existing
LL_64BIT_BUILD reference to test (ADDRESS_SIZE EQUAL 64) instead.
|
|
DRTVWR-412 Bento (avatar skeleton extensions)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The Visual C++ runtime produces typeid(MyClass).name() as "class MyClass".
It's prudent to check for the presence of that prefix before stripping off the
first six characters, but if the first comparison should ever fail, find()
would continue searching the rest of the string for "class " -- a search
guaranteed to fail. Use compare() instead.
|
|
|
|
A shocking number of LLSingleton subclasses had public constructors -- and in
several instances, were being explicitly instantiated independently of the
LLSingleton machinery. This breaks the new LLSingleton dependency-tracking
machinery. It seems only fair that if you say you want an LLSingleton, there
should only be ONE INSTANCE!
Introduce LLSINGLETON() and LLSINGLETON_EMPTY_CTOR() macros. These handle the
friend class LLSingleton<whatevah>;
and explicitly declare a private nullary constructor.
To try to enforce the LLSINGLETON() convention, introduce a new pure virtual
LLSingleton method you_must_use_LLSINGLETON_macro() which is, as you might
suspect, defined by the macro. If you declare an LLSingleton subclass without
using LLSINGLETON() or LLSINGLETON_EMPTY_CTOR() in the class body, you can't
instantiate the subclass for lack of a you_must_use_LLSINGLETON_macro()
implementation -- which will hopefully remind the coder.
Trawl through ALL LLSingleton subclass definitions, sprinkling in
LLSINGLETON() or LLSINGLETON_EMPTY_CTOR() as appropriate. Remove all explicit
constructor declarations, public or private, along with relevant 'friend class
LLSingleton<myself>' declarations. Where destructors are declared, move them
into private section as well. Where the constructor was inline but nontrivial,
move out of class body.
Fix several LLSingleton abuses revealed by making ctors/dtors private:
LLGlobalEconomy was both an LLSingleton and the base class for
LLRegionEconomy, a non-LLSingleton. (Therefore every LLRegionEconomy instance
contained another instance of the LLGlobalEconomy "singleton.") Extract
LLBaseEconomy; LLGlobalEconomy is now a trivial subclass of that.
LLRegionEconomy, as you might suspect, now derives from LLBaseEconomy.
LLToolGrab, an LLSingleton, was also explicitly instantiated by
LLToolCompGun's constructor. Extract LLToolGrabBase, explicitly instantiated,
with trivial subclass LLToolGrab, the LLSingleton instance.
(WARNING: LLToolGrabBase methods have an unnerving tendency to go after
LLToolGrab::getInstance(). I DO NOT KNOW what should be the relationship
between the instance in LLToolCompGun and the LLToolGrab singleton instance.)
LLGridManager declared a variant constructor accepting (const std::string&),
with the comment:
// initialize with an explicity grid file for testing.
As there is no evidence of this being called from anywhere, delete it.
LLChicletBar's constructor accepted an optional (const LLSD&). As the LLSD
parameter wasn't used, and as there is no evidence of it being passed from
anywhere, delete the parameter.
LLViewerWindow::shutdownViews() was checking LLNavigationBar::
instanceExists(), then deleting its getInstance() pointer -- leaving a
dangling LLSingleton instance pointer, a land mine if any subsequent code
should attempt to reference it. Use deleteSingleton() instead.
~LLAppViewer() was calling LLViewerEventRecorder::instance() and then
explicitly calling ~LLViewerEventRecorder() on that instance -- leaving the
LLSingleton instance pointer pointing to an allocated-but-destroyed instance.
Use deleteSingleton() instead.
|