summaryrefslogtreecommitdiff
path: root/AK
AgeCommit message (Collapse)Author
2022-03-07AK: Automatically shrink HashTable when removing entriesAndreas Kling
If the utilization of a HashTable (size vs capacity) goes below 20%, we'll now shrink the table down to capacity = (size * 2). This fixes an issue where tables would grow infinitely when inserting and removing keys repeatedly. Basically, we would accumulate deleted buckets with nothing reclaiming them, and eventually deciding that we needed to grow the table (because we grow if used+deleted > limit!) I found this because HashTable iteration was taking a suspicious amount of time in Core::EventLoop::get_next_timer_expiration(). Turns out the timer table kept growing in capacity over time. That made iteration slower and slower since HashTable iterators visit every bucket.
2022-03-07AK: Remove return value from HashTable::remove() and HashMap::remove()Andreas Kling
This was only used by remove_all_matching(), where it's no longer used.
2022-03-07AK: Simplify HashTable::remove_all_matching()Andreas Kling
Just walk the table from start to finish, deleting buckets as we go. This removes the need for remove() to return an iterator, which is preventing me from implementing hash table auto-shrinking.
2022-03-04LibWeb: Hide some debug logging behind CANVAS_RENDERING_CONTEXT_2D_DEBUGLinus Groh
This can be quite noisy and isn't generally useful information.
2022-03-02AK: Print NaN and infinite numbers in PrintfImplementationPeter Ross
2022-02-28AK: Add Time::from_ticks()Lucas CHOLLET
This helper allows Time to be constructed from a tick count and a ticks per second value.
2022-02-28AK: Correctly process precision modifiers in printfTimur Sultanov
2022-02-28AK: Add FixedPoint base 2 logarithmkleines Filmröllchen
The log base 2 is implemented using the binary logarithm algorithm by Clay Turner (see the link in the comment)
2022-02-28AK: Add bit shift to FixedPointkleines Filmröllchen
2022-02-28AK: Fix FixedPoint to integral comparisonskleines Filmröllchen
Add tests to ensure that the fixed point numbers compare correctly to integrals
2022-02-27Everywhere: Make JSON serialization fallibleIdan Horowitz
This allows us to eliminate a major source of infallible allocation in the Kernel, as well as lay down the groundwork for OOM fallibility in userland.
2022-02-27AK: Add a try variant of StringBuilder::append_escaped_for_jsonIdan Horowitz
This will allow us to make a fallible version of the JSON serializers.
2022-02-27AK: Skip over initial empty chunks in DisjointChunkskleines Filmröllchen
This will be caught by new test cases: when the initial chunk is empty, a dereference before calling operator++ on the iterator will crash as the initial chunk's size is never checked.
2022-02-27AK: Make DisjointChunks support FixedArraykleines Filmröllchen
This extracts the shatter_chunk logic, because it needs to be different for FixedArray.
2022-02-27AK: Make DisjointChunk::append move the new chunkkleines Filmröllchen
Previously, although we were taking a moved chunk, we still copied it into our chunk list. This makes DisjointChunk compatible with containers that don't have a copy constructor but a move constructor.
2022-02-27AK: Export DisjointSpans into the global namespacekleines Filmröllchen
I think we just forgot when we added it.
2022-02-27AK: Add at() indexing methods to FixedArraykleines Filmröllchen
2022-02-27AK: Allow creating a FixedArray from an initializer listkleines Filmröllchen
2022-02-27AK: Add FixedArray::is_empty()kleines Filmröllchen
This also exists on Vector, and although it's less needed here, it's perfectly reasonable to have.
2022-02-26AK: Add constructor to create Span from ArrayArne Elster
It's a convenience constructor. But it also seems more consistent to allow a Span being made from both raw and managed arrays.
2022-02-26AK: Array can tell its inner typeArne Elster
Array should be able to tell the type of the elements it contains.
2022-02-25AK: Ignore whitespace while decoding base64Andreas Kling
This matches how other implementations behave. 1% progression on ACID3. :^)
2022-02-25AK: Add String::split_view(Function<bool(char)>)Andreas Kling
This allows you to split around a custom separator, and enables expressive code like this: string.split_view(is_ascii_space);
2022-02-23AK: Add forward declaration for Utf8CodePointIteratorLinus Groh
2022-02-23AK: Add optional format string parameter to String{,Builder}::join()Linus Groh
Allow specifying a custom format string that's being used for each item instead of hardcoding "{}".
2022-02-23AK: Add Traits<Span<T>>::hash()Linus Groh
2022-02-23AK: Add the Fundamental conceptkleines Filmröllchen
2022-02-23AK: Prevent Atomic with complex typeskleines Filmröllchen
This would throw some really weird linker errors, so let's prevent it from happening instead!
2022-02-21AK: Suppress clang-tidy warning on TODO()Max Wipfli
This adds a NOLINT directive to the definition of the TODO() macro. clang-tidy wants the assert replaced with a static_assert, since the macro simply resolves to assert(false). This is obviously nonsensical, since we want the code to still compile even with TODO(). The same fix has already been implemented for VERIFY_NOT_REACHED().
2022-02-19AK: Add fast path in String::trim() and String::trim_whitespace()Andreas Kling
If the trimmed string would be the entire string, just return *this instead of creating a new StringImpl.
2022-02-19AK: Make CaseInsensitiveStringTraits allocation-freeAndreas Kling
Instead of calling String::to_lowercase(), do case-insensitive hashing and comparison.
2022-02-19AK: Don't use x86 assembly when building for non-x86 targetsGunnar Beutner
This allows Lagom to be built successfully for Apple M1. Fixes #12644.
2022-02-17LibWeb: Add partially functioning Worker APIBen Abraham
Add a partial implementation of HTML5 Worker API. Messages can be sent from the inner context externally.
2022-02-16AK: VERIFY inside release_value_but_fixme_should_propagate_errors()Sam Atkins
While the code did already VERIFY that the ErrorOr holds a value, this was done by Variant, so the error message was just that `has<T>()` is false. This is less helpful than I would like, especially if backtraces are not working and this is all you have to go on. Adding this extra VERIFY means the assertion message (`!is_error()`) is easier to understand.
2022-02-16AK: Exclude StringUtils String APIs from the KernelIdan Horowitz
These APIs are only used by userland, and String is OOM-infallible, so let's just ifdef it out of the Kernel.
2022-02-16AK: Exclude StringView String APIs from the KernelIdan Horowitz
These APIs are only used by userland, and String is OOM-infallible, so let's just ifdef it out of the Kernel.
2022-02-16AK: Exclude StringBuilder String APIs from the KernelIdan Horowitz
These APIs are only used by userland, and String is OOM-infallible, so let's just ifdef it out of the Kernel.
2022-02-16AK: Exclude JsonValue String APIs from the KernelIdan Horowitz
These APIs are only used by userland, and String is OOM-infallible, so let's just ifdef it out of the Kernel.
2022-02-16AK: Use string_view() instead of to_string() in Formatter<wchar_t>Idan Horowitz
This let's us avoid a heap allocation.
2022-02-16AK: Exclude GenericLexer String APIs from the KernelIdan Horowitz
These APIs are only used by userland, and String is OOM-infallible, so let's just ifdef it out of the Kernel.
2022-02-16AK: Return KString instead of String from encode_hex in the KernelIdan Horowitz
This let's us propagate allocation errors from this API.
2022-02-16AK+Kernel: Specialize Trie for NNOP<KString> and use it in UnveilNodeIdan Horowitz
This let's us avoid the infallible String allocations.
2022-02-16AK+Kernel: Return KString from UUID::to_string() in the KernelIdan Horowitz
This lets us safely handle allocation failure.
2022-02-16AK+Kernel: Return KString from MACAddress::to_string() in the KernelIdan Horowitz
This lets us safely handle allocation failure.
2022-02-16AK+Kernel: Return KString from IPv4Address::to_string() in the KernelIdan Horowitz
This lets us safely handle allocation failure.
2022-02-16AK: Fix userland parsing of rounded floating point numbersserenitydev
Parse JSON floating point literals properly, No longer throwing a SyntaxError when the decimal portion of the number exceeds the capacity of u32. Added tests to AK/TestJSON and LibJS/builtins/JSON/JSON.parse
2022-02-15AK+Kernel: OOM-harden most parts of TrieAli Mohammad Pur
The only part of Unveil that can't handle OOM gracefully is the String::formatted() use in the node metadata.
2022-02-15AK: Conditionally disable a few variant ctors/assignmentsAli Mohammad Pur
We shouldn't let copy/move ctors or assignments be instantiated if the assignee type does not have a copy/move constructor (even if they're not used anywhere).
2022-02-15AK: Add a 'SpecializationOf' conceptAli Mohammad Pur
The counterpart to the IsSpecializationOf<...> template.
2022-02-13Kernel: Remove make_weak_ptr()Idan Horowitz
New users of WeakPtr in the kernel should use try_make_weak_ptr instead