summaryrefslogtreecommitdiff
path: root/indra/llcommon
AgeCommit message (Collapse)Author
2024-10-22Merge branch 'develop' into marchcat/xcode-16Nat Goodspeed
2024-10-22Remove moveNat Goodspeed
2024-10-22Eliminate meaningless blank lineNat Goodspeed
2024-10-22Make llcoro::scheduler log coros that run too long between yields.Nat Goodspeed
Introduce LLCoros::CoroData::mHistogram, a map of cutoff times (bucket breakpoints) with counts of occurrences. The idea is that mHistogram counts how many times the real time taken by a particular coroutine resumption falls into one of those buckets. Initialize the map with guessed buckets; these are set in llcoros.cpp so they can be changed without requiring extensive rebuilds. scheduler::pick_next() now records the timestamp and fiber context just before the fiber manager resumes the next coroutine. If the next pick_next() call reveals that the previous resumption took longer than the minimum bucket breakpoint, it increments the appropriate bucket counter and logs the instance. LLCoros::toplevel() reports nonzero mHistogram entries on coroutine termination.
2024-10-22Eliminate double names for coros + "empty name is main" convention.Nat Goodspeed
Instead, introduce bool CoroData::isMain and test that. Use "main" for the name of the main coroutine. That eliminates the logname() method, also the llcoro::logname() free function. It also obviates the alternate CoroData constructor. Use boost::fibers::fiber::id as the LLInstanceTracker key for CoroData, instead of the coroutine name. Introduce get_CoroData(id), also getName(id). Extract static CoroData for the main coroutine to main_CoroData() so both get_CoroData() overloads can use it. Ditch unused get_CoroData(string) parameter: now get_CoroData(). Introduce LLCoros::mNameMap for lookup by name (e.g. killreq()). CoroData's constructor puts an entry into mNameMap; the destructor removes it. Since mNameMap is thread_local (unlike an LLInstanceTracker key), that theoretically permits duplicate coroutine names on different threads. Introduce mPrefixMap to help generate distinct coroutine names, instead of a single scalar. Introduce CoroData::getName(), and use it in both LLCoros::getName() overloads. CoroData::getName() appends mStatus if it's not empty. This is useful for disambiguating generic pool coroutines based on the current task.
2024-10-14Private Issue #297: Accept new flags in ScriptTeleportRequest message. Flags ↵Rider Linden
indicate if the world map should be opened and focused.
2024-10-08Merge branch 'develop' into marchcat/xcode-16Andrey Lihatskiy
# Conflicts: # .github/workflows/build.yaml # indra/llmath/raytrace.cpp
2024-10-04Merge remote branch 'develop' into marchcat/xcode-16Nat Goodspeed
2024-10-03fix GameControl save settings, fix linux buildAndrew Meadows
2024-10-03remove crashy LLSD ctor used by GameControlleviathan
2024-10-03Add GameControl UI for per device settingsAlexander Gavriliuk
2024-10-03avatar_motion-->GameControl translation and flycamLeviathan Linden
2024-10-03add GameControl feature and SDL2 dependencyLeviathan Linden
2024-10-02Add a lot of more constexpr; use constants for accessing vector indices in ↵Ansariel Hiller
vector math classes (#2766)
2024-09-30Fix or workaround test build failures on linuxRye Cogtail
2024-09-30Fix -Wpessimizing-move warning in makeClassicCallbackRye Cogtail
2024-09-30Fix GCC warning about unused _out parameter in LL_DEBUGSRye Cogtail
2024-09-29Zap trailing spaces.Nat Goodspeed
2024-09-29Try to eliminate the runtime cost of `ll_convert_to<T>(const T&)`.Nat Goodspeed
2024-09-27Slightly streamline owning_ptr class definition.Nat Goodspeed
2024-09-27Introduce owning_ptr<T>; use it for JPEG2KEncode and JPEG2KDecode.Nat Goodspeed
owning_ptr<T> adapts std::unique_ptr<T> to be a better drop-in replacement for a legacy class that formerly stored plain T* data members, and explicitly destroyed them using domain-specific destructor functions. Directly substituting std::unique_ptr into JPEG2KEncode and JPEG2KDecode was cumbersome because every such pointer declaration required a redundant template parameter describing the deleter function passed into its constructor. Moreover, it required lots of little syntax tweaks: changing every assignment to a reset() call, changing every reference to a get() call. Using owning_ptr<T> allows us to leave the code more or less as it was before, save that assignment and destruction automatically handle the previous referenced T instance.
2024-09-27Migrate ~LLPointer()'s peculiar warning case to llpointer.cpp.Nat Goodspeed
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.
2024-09-26Ditch last instances of LL_LIBRARY_INCLUDE.Nat Goodspeed
2024-09-26get rid of extra LL in help textMnikolenko Productengine
2024-09-26Fix GCC ambiguous-reversed-operator errors for `LLKeyData` compares.Nat Goodspeed
`LLKeyData::operator==(const LLKeyData&)` and `operator!=(const LLKeyData&)` were not themselves `const` methods. In C++20, that can produce a fatal warning that if the compare operands were reversed, you'd get different results. Making them both `const` should fix it. While touching the method definitions, make `operator==()` more intuitive, and make `operator!=()` simply negate `operator==()` instead of restating it in reverse.
2024-09-26Fix a few more fsyspath conversions, removing explicit u8string().Nat Goodspeed
2024-09-25Adapt `fsyspath` for C++20 conventions.Nat Goodspeed
In C++20, `std::filesystem::u8path()` (that accepts a UTF-8 encoded `std::string` and returns a `std::filesystem::path`) is deprecated. Instead, to engage UTF-8 coding conversions, we're supposed to pass the `path` constructor a `std::u8string`, i.e. a `std::basic_string<char8_t>`. Since `char8_t` is a type distinct from both `char` and `unsigned char`, we must Do Something to pass a UTF-8 encoded `std::string` into `std::filesystem::path`. To avoid copying characters from a `std::string` into a temporary `std::u8string` and from there into the `std::filesystem::path`, make a `boost::transform_iterator` that accepts a `std::string_view::iterator` and adapts it to dereference `char8_t` characters. Make `fsyspath(std::string_view)` engage the base-class constructor accepting (iterator, iterator), adapting `string_view::begin()` and `end()` to deliver `char8_t` characters. Use the same tactic for `fsyspath::operator=(std::string_view)`, explicitly calling `std::filesystem::path::assign()` with the adapted iterators. To resolve ambiguities, provide both constructors and assignment operators accepting `(const std::string&)` and `(const char*)`, explicitly converting each to `std::string_view`. At the same time, `std::filesystem::path::u8string()` now returns `std::u8string` rather than `std::string`. Since `std::filesystem::path` delivers only that `std::u8string` rather than iterators into its internal representation, we can't avoid capturing it and copying to the returned `std::string`. Remove explicit `.u8string()` calls from a few existing `fsyspath` instances, now that `fsyspath` supports implicit conversion to `std::string`.
2024-09-25Merge branch 'develop' into marchcat/xcode-16Nat Goodspeed
2024-09-25Explain why apparently redundant LLPointer methods are necessary.Nat Goodspeed
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.
2024-09-25Use copy-and-swap idiom for LLPointer's assignment operators.Nat Goodspeed
This affords strong exception safety. Also, eliminating the conditional may improve speed.
2024-09-24LLConstPointer<T> is the same as LLPointer<const T>.Nat Goodspeed
Instead of restating the whole class, requiring changes to be made in parallel (which has already failed), just make a template alias.
2024-09-24Make `LLPointer` equality comparisons accept not-identical types.Nat Goodspeed
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.
2024-09-24Merge pull request #2534 from secondlife/release/luau-scriptingnat-goodspeed
Add Lua scripting to develop, behind feature flag
2024-09-24Reduce memory allocations pinging the mainloop timeoutAnsariel
2024-09-23Merge remote 'release/luau-scripting' into release/luau-scriptingNat Goodspeed
2024-09-23include <utility> for Linux: std::forward is not predefinedNat Goodspeed
2024-09-23Merge remote branch 'develop' into release/luau-scripting for Maint BNat Goodspeed
2024-09-23Merge branch 'develop' into marchcat/b-developAndrey Lihatskiy
# Conflicts: # indra/newview/llfeaturemanager.cpp # indra/newview/llviewertexturelist.cpp # indra/newview/llvoicewebrtc.cpp
2024-09-23Merge remote branch 'develop'into release/luau-scriptingNat Goodspeed
2024-09-20Update test for changed message in error case.Nat Goodspeed
2024-09-20Merge branch 'release/luau-scripting' into lua-script-argsNat Goodspeed
2024-09-20Add ability to pass command-line arguments to a Lua script.Nat Goodspeed
Introduce `ScriptCommand` class that parses a command line into a script name and optional args, using bash-like quoting and escaping. `ScriptCommand` searches for a file with that script name on a passed list of directories; the directories may be specified relative to a particular base directory. `ScriptCommand` supports the special case of a script name containing unescaped spaces. It guarantees that either the returned script file exists, or its `error()` string is non-empty. Replace `LLLeap::create()` logic, from which `ScriptCommand` was partly derived, with a `ScriptCommand` instance. Make `LLLUAmanager::runScriptFile()` use a `ScriptCommand` instance to parse the passed command line. Subsume `LLAppViewer::init()` script-path-searching logic for `--luafile` into `ScriptCommand`. In fact that lambda now simply calls `LLLUAmanager::runScriptFile()`. Make `lluau::dostring()` accept an optional vector of script argument strings. Following PUC-Rio Lua convention, pass these arguments into a Lua script as the predefined global `arg`, and also as the script's `...` argument. `LuaState::expr()` also accepts and passes through script argument strings. Change the log tag for the Lua script interruption message: if we want it, we can still enable it, but we don't necessarily want it along with all other "Lua" DEBUG messages. Remove `LuaState::script_finished_fn`, which isn't used any more. Also remove the corresponding `LLLUAmanager::script_finished_fn`. This allows us to simplify `~LuaState()` slightly, as well as the parameter signatures for `LLLUAmanager::runScriptFile()` and `runScriptLine()`.
2024-09-19Merge pull request #2610 from secondlife/frame-profile-jsonnat-goodspeed
Make Develop->Render Tests->Frame Profile dump JSON to a file too.
2024-09-19viewer#2608 Crash at LLSnapshotLivePreview::getFormattedImageAndrey Kleshchev
2024-09-19trailing spaces from other branchesNat Goodspeed
2024-09-19Merge branch 'develop' into frame-profile-jsonNat Goodspeed
2024-09-18Turn off sLogInSignal to avoid crashing. (#2607)Brad Linden
fixes secondlife/viewer#2566
2024-09-18Add hexdump.h with iostream manipulators to dump a byte range as hexNat Goodspeed
or to produce readable text from a mix of printing and nonprinting ASCII characters. (cherry picked from commit 01a59bab1a4b7c4645271a21cfaadc3735b6029c)
2024-09-18Ditch trailing space.Nat Goodspeed
2024-09-18Give our fsyspath an operator std::string() conversion method.Nat Goodspeed
This is redundant (but harmless) on a Posix system, but it fills a missing puzzle piece on Windows. The point of fsyspath is to be able to interchange freely between fsyspath and std::string. Existing fsyspath could be constructed and assigned from std::string, and we could explicitly call its string() method to get a std::string, but an implicit fsyspath-to-string conversion that worked on Posix would trip us up on Windows. Fix that. (cherry picked from commit fbeff6d8052d4b614a0a2c8ebaf35b45379ab578)