Skip to content

Conversation

@RyeMutt
Copy link
Contributor

@RyeMutt RyeMutt commented Jan 4, 2026

Description

This extracts and rebases a series of changes from archive/develop that provides some nice cleanup and modernizations to LLPointer.

Related Issues

Issue Link: #5078


Checklist

Please ensure the following before requesting review:

  • I have provided a clear title and detailed description for this pull request.
  • If useful, I have included media such as screenshots and video to show off my changes.
  • The PR is linked to a relevant issue with sufficient context.
  • I have tested the changes locally and verified they work as intended.
  • All new and existing tests pass.
  • Code follows the project's style guidelines.
  • Documentation has been updated if needed.
  • Any dependent changes have been merged and published in downstream modules
  • I have reviewed the contributing guidelines.

Additional Notes

That is, both `LLPointer::operator==()` and `operator!=()` and the free function
`operator==()` and `operator!=()` now accept pointer types other than the type
of the subject `LLPointer`, letting the compiler apply implicit pointer
conversions or diagnose an error.
Instead of restating the whole class, requiring changes to be made in parallel
(which has already failed), just make a template alias.
This affords strong exception safety. Also, eliminating the conditional may
improve speed.
Given templated constructors and assignment operators, it's tempting to remove
specific constructors and assignment operators with the same LLPointer<Type>
parameters. That turns out to be a mistake. Add comments to warn future
maintainers.
This allows removing #include "llerror.h" from llpointer.h.
Also remove #include "llmutex.h" as a heavy way to get
<boost/functional/hash.hpp>.

That requires adding #include "llmutex.h" to llimage.h, llnotifications.h,
llwatchdog.cpp and llvolumemgr.cpp, which were inheriting it from llpointer.h.

#include "llerror.h" // *TODO: consider eliminating this
#include "llmutex.h"
#include <boost/functional/hash.hpp>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any idea why we aren't using std::hash here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a std::hash and a boost::hash specialization down at the bottom of the file so that we have compatibility with both.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw the 'struct hash' thing, but why do we need the boost variant and are not just cutting that part of the lib out?.

Copy link
Contributor Author

@RyeMutt RyeMutt Jan 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems safe to remove it as we don't appear to be using any boost hash containers with LLPointer.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

…d::hash specialization to use std::hash internally

Signed-off-by: Rye <[email protected]>
@akleshchev akleshchev linked an issue Jan 5, 2026 that may be closed by this pull request
@akleshchev akleshchev merged commit 112f9b9 into secondlife:develop Jan 5, 2026
12 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jan 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Code modernization and cleanup contributions

3 participants