-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AK: Cherry Pick the Optional changes from LB #25337
base: master
Are you sure you want to change the base?
Commits on Nov 9, 2024
-
AK: Remove StringBuilder's UseInlineCapacityOnly feature
This feature is unused in Ladybird and will complicate an upcoming patch to hand-off StringBuilder's memory to String. (cherry picked from commit af220af8bf15f9eb297a165e6d2ae3bf5bbc49fc)
Configuration menu - View commit details
-
Copy full SHA for 25a4238 - Browse repository at this point
Copy the full SHA 25a4238View commit details -
AK: Add missing includes to StringData.h
Opening StringData.h in any clangd-enabled editor previously resulted in a sea of clangd errors. (cherry picked from commit 77eef8a8f6723b1e2fb5107aac7cf39bc1b40dad)
Configuration menu - View commit details
-
Copy full SHA for c39b1ba - Browse repository at this point
Copy the full SHA c39b1baView commit details -
AK: Construct Strings from StringBuilder without re-allocating the data
Currently, invoking StringBuilder::to_string will re-allocate the string data to construct the String. This is wasteful both in terms of memory and speed. The goal here is to simply hand the string buffer over to String, and let String take ownership of that buffer. To do this, StringBuilder must have the same memory layout as Detail::StringData. This layout is just the members of the StringData class followed by the string itself. So when a StringBuilder is created, we reserve sizeof(StringData) bytes at the front of the buffer. StringData can then construct itself into the buffer with placement new. Things to note: * StringData must now be aware of the actual capacity of its buffer, as that can be larger than the string size. * We must take care not to pass ownership of inlined string buffers, as these live on the stack. (cherry picked from commit 29879a69a4b2eda4f0315027cb1e86964d333221; amended minor conflict in AK/String.h due to us not having String::from_utf16() from LadybirdBrowser/ladybird#674, last commit)
Configuration menu - View commit details
-
Copy full SHA for 4a91f21 - Browse repository at this point
Copy the full SHA 4a91f21View commit details -
LibJS: Pre-allocate the resolved rope string's underlying buffer
For performance, rather than slowly incrementing the capacity of the rope string's buffer, compute an approximate length for that buffer to be reserved up front. (cherry picked from commit e8f4ae487d228dac491a446ed548400176331ae9)
Configuration menu - View commit details
-
Copy full SHA for 92b580d - Browse repository at this point
Copy the full SHA 92b580dView commit details -
AK: Add a ASSERT() wrapper for Ladybird upstream compatibility
In contrast to Ladybird, we won't disable assertions in release builds, though.
Configuration menu - View commit details
-
Copy full SHA for a2fcf55 - Browse repository at this point
Copy the full SHA a2fcf55View commit details -
AK: Add
OptionalBase
class to reduce code duplicationUsing CRTP and `static_cast`s because "deducing this" is still not fully supported yet. (cherry picked from commit a70ed6a2ada94df63e12c94d35166b7d4ca0b90a)
Configuration menu - View commit details
-
Copy full SHA for 80dc181 - Browse repository at this point
Copy the full SHA 80dc181View commit details -
AK: Move "conditional xtor" pattern into a macro
`Optional` and `Variant` both use essentially the same pattern of only declaring a copy constructor/move constructor/destructor and copy/move assignment operator if all of their template parameters have one. Let's move these into a macro to avoid code duplication and to give a name to the thing we are trying to accomplish. (cherry picked from commit fcdf3014f1bfbc9b90560d0399f0dbc33ccca9b6)
Configuration menu - View commit details
-
Copy full SHA for 849acbf - Browse repository at this point
Copy the full SHA 849acbfView commit details -
AK: Add template specializations for
Optional<{,Fly}String>
Slice the size of `Optional<{,Fly}String>` in half by introducing `UINTPTR_MAX` as an invalid bit pattern for these values. (cherry picked from commit 2457118024a9d3b39178bba0e92c34923b381f20)
Configuration menu - View commit details
-
Copy full SHA for ce5882d - Browse repository at this point
Copy the full SHA ce5882dView commit details -
LibWeb: Fix use-after-move in
URLSearchParams::update
This was previously still valid since the `Optional<String>` move constructor copied its input, but since the move is now destructive, the code no longer works. (cherry picked from commit a733e2a31c0c67ee262a1676c5ad8e0d7415dbbb)
Configuration menu - View commit details
-
Copy full SHA for b0b2fde - Browse repository at this point
Copy the full SHA b0b2fdeView commit details