mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 20:29:18 +00:00
LibJS: Make Optional<Utf16String> use less space
Some checks are pending
CI / Lagom (arm64, Sanitizer_CI, false, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (x86_64, Fuzzers_CI, false, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, false, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, true, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
Some checks are pending
CI / Lagom (arm64, Sanitizer_CI, false, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (x86_64, Fuzzers_CI, false, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, false, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, true, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
By specializing the template, we can shrink it from 16 to 8 bytes. This makes PrimitiveString a measly 32 bytes. :^)
This commit is contained in:
parent
152691f9eb
commit
4dc63ddf49
Notes:
github-actions[bot]
2025-03-30 06:17:42 +00:00
Author: https://github.com/awesomekling
Commit: 4dc63ddf49
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4149
Reviewed-by: https://github.com/Hendiadyoin1
Reviewed-by: https://github.com/tcl3 ✅
2 changed files with 106 additions and 1 deletions
|
@ -84,6 +84,12 @@ Utf16String Utf16String::create(Utf16View const& string)
|
|||
return Utf16String { Detail::Utf16StringImpl::create(string) };
|
||||
}
|
||||
|
||||
Utf16String Utf16String::invalid()
|
||||
{
|
||||
static auto invalid = Utf16String {};
|
||||
return invalid;
|
||||
}
|
||||
|
||||
Utf16String::Utf16String(NonnullRefPtr<Detail::Utf16StringImpl> string)
|
||||
: m_string(move(string))
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue