Commit graph

2351 commits

Author SHA1 Message Date
Nico Weber a17b2248f2 LibHTTP+AK: Rename CHTTPJOB_DEBUG to HTTPJOB_DEBUG 2022-01-23 00:45:22 +00:00
Nico Weber 6d532649d4 RequestServer+AK: Move happy-path logging behind REQUESTSERVER_DEBUG
vdbgln() was responsible for ~10% of samples on pv's flamegraph for
RequestServer (under request_did_finish) when loading github.com in
Browser and recording a whole-system profile. This makes that almost
completely disappear.
2022-01-22 01:28:01 +00:00
davidot 0b89dbc529 Meta: Add JS_MODULE_DEBUG define flag 2022-01-22 01:21:18 +00:00
kleines Filmröllchen caeb8fc691 LibCore: Introduce BigEndianInputBitStream
BigEndianInputBitStream is the Core::Stream API's bitwise input stream
for big endian input data. The functionality and bitwise read API is
almost unchanged from AK::BitStream, except that this bit stream only
supports big endian operations.

As the behavior for mixing big endian and little endian reads on
AK::BitStream is unknown (and untested), it was never done anyways. So
this was a good opportunity to split up big endian and little endian
reading.

Another API improvement from AK::BitStream is the ability to specify
the return type of the bit read function. Always needing to static_cast
the result of BitStream::read_bits_big_endian into the desired type is
adding a lot of avoidable noise to the users (primarily FlacLoader).
2022-01-22 01:13:42 +03:30
Idan Horowitz 7356110033 AK: Support setting with non copyable keys in HashMap 2022-01-21 16:27:21 +01:00
ForLoveOfCats 1d95fd5443 AK: Identify negative zero when parsing Json and represent with a double
Regardless of the backing type that the number would otherwise parse to,
if it is zero and the sign was supposed to be negative then it needs to
be a floating point number to represent the correct value.
2022-01-19 21:51:09 +00:00
Timothy Flynn e9e8e2bdf4 AK: Add helper to convert an epoch time in seconds to a year 2022-01-19 21:20:41 +00:00
Timothy Flynn bc719e7bac AK: Put an empty new line between function definitions in AK::Time
There was over 110 lines without a single line break, let's give our
eyes a break.
2022-01-19 21:20:41 +00:00
Idan Horowitz 404daa0e33 AK: Yield while waiting for another thread to create a strong ref 2022-01-19 01:28:13 +01:00
Idan Horowitz aa29e38ad5 AK: Yield while waiting for another thread to initialize a Singleton 2022-01-19 01:28:13 +01:00
Lucas CHOLLET b0d51a6f36 AK: Fix erroneous move operators for SinglyLinkedList
This patch provides a proper implementation of the move operator and
delete the move assignment operator.

Those operators were introduced in #11888
2022-01-19 00:13:56 +01:00
Timothy Flynn b87e517deb AK: Remove now-unused AK::UnicodeUtils methods 2022-01-18 15:13:25 +00:00
Idan Horowitz 4774bed589 AK: Make Utf8View constexpr-constructible 2022-01-17 14:46:07 +00:00
Jelle Raaijmakers 11c807ebd1 LibGL+LibSoftGPU: Implement the stencil buffer
This implements an 8-bit front stencil buffer. Stencil operations are
SIMD optimized. LibGL changes include:

* New `glStencilMask` and `glStencilMaskSeparate` functions
* New context parameter `GL_STENCIL_CLEAR_VALUE`
2022-01-17 12:49:00 +01:00
Michel Hermier cb3cc6ec27 AK: Remove kfree definition 2022-01-16 11:18:04 +01:00
Michel Hermier 9039f8fb0f AK: Remove kcalloc definition 2022-01-16 11:18:04 +01:00
Matt Jacobson 47e8d58553 AK: Fix logic in String::operator>(const String&)
Null strings should not compare greater than non-null strings.

Add tests for >, <, >=, and <= comparison involving null strings.
2022-01-16 11:08:23 +01:00
Idan Horowitz 8a879e205b AK: Mark the error branch of the TRY() macro as unlikely
This results in a measurable (and free!) 2% improvement in test-js
run time.
2022-01-16 02:01:23 +02:00
creator1creeper1 4869dda79f AK: Explicitly name types in Iterator.h
In this particular case, auto is a footgun, because we are very
certain about the type that we want to return. const-correctness
could have been violated (as Vector did), because Iterator did not
enforce that the returned pointer was actually const if the Iterator
was an Iterator over a const container.
2022-01-16 00:38:21 +03:30
creator1creeper1 6484d42933 AK: Make Vector more const-correct by using RemoveReference<T>
Methods marked as const should always only return Foo const&, never
Foo&. Previously, this only worked correctly with Foo, but not with
Foo&: If someone fetched a T const&, this would have been expanded
to Foo& const& which is just Foo&. Therefore, they were able to modify
the elements of the Vector, even though it was marked as const.
This commit fixes that by introducing VisibleType as an alias for
RemoveReference<T> and using it throughout Vector.

There are also other cases where we don't require a mutable reference
to the underlying type, only a const reference (for example in a find
operation). In these cases, we now also correctly expand the type
to Foo const&.
2022-01-16 00:38:21 +03:30
creator1creeper1 64778f9e69 AK: Add a constructor from Span for FixedArray
This is particularly useful in the Kernel, where the physical pages of
a VMObject are stored as a FixedArray but often passed around as a Span
from which a new FixedArray should be cloned.
2022-01-15 22:16:00 +02:00
creator1creeper1 0362b15895 AK: Add a constructor from C-style arrays for FixedArray
We really want to be able to construct FixedArray from a list of
non-copyable but movable objects. This constructor is useful for
such things.
2022-01-15 22:16:00 +02:00
Lucas CHOLLET 1222eba0fb AK: Explicitly define copy and assignment operator for SinglyLinkedList
Defined operators:
 - SinglyLinkedList(const SinglyLinkedList&) - deleted
 - SinglyLinkedList(SinglyLinkedList&&) - defaulted
 - SinglyLinkedList& operator=(const SinglyLinkedList&) - deleted
 - SinglyLinkedList& operator=(SinglyLinkedList&&) - defaulted
2022-01-15 01:44:12 +01:00
Timothy Flynn 820dc1fc53 AK: Use appropriate types in AK::Time::from_timestamp factory
Allow the provided year to be negative, and allow millisecond values
larger than 255.
2022-01-14 22:39:06 +01:00
kleines Filmröllchen be6418cc50 Everywhere: Use my new serenityos.org e-mail :^) 2022-01-14 11:54:09 +01:00
Ali Mohammad Pur 95b8c1745a AK: Make Variant::visit() prefer overloads accepting T const& over T&
This makes the following code behave as expected:

    Variant<int, String> x { some_string() };
    x.visit(
        [](String const&) {}, // Expectation is for this to be called
        [](auto&) {});
2022-01-14 11:35:40 +03:30
Ali Mohammad Pur 9de33629da AK+Everywhere: Make Variant::visit() respect the Variant's constness
...and fix all the instances of visit() taking non-const arguments.
2022-01-14 11:35:40 +03:30
sin-ack 28063de488 AK: Add ByteBuffer::{must_,}get_bytes_for_writing()
This is useful for writing new data at the end of a ByteBuffer. For
instance, with the Stream API:

    auto pending_bytes = TRY(stream.pending_bytes());
    auto receive_buffer = TRY(buffer.get_bytes_for_writing(
        pending_bytes));
    TRY(stream.read(receive_buffer));
2022-01-13 15:16:12 +03:30
sin-ack 9569841589 AK: Use Error::from_errno in adopt_nonnull_own_or_enomem
This fails to build on Lagom otherwise.
2022-01-13 15:16:12 +03:30
kleines Filmröllchen 068aea660c AK: Explain why FixedArray has no move assignment 2022-01-13 11:17:44 +01:00
kleines Filmröllchen 594bbbf020 Tests: Test FixedArray completely
Except for tangential accessors such as data(), there is no more feature
of FixedArray that is untested after this large expansion of its test
cases. These tests, with the help of the new NoAllocationGuard, also
test the allocation contract that was fixated in the last commit.

Hopefully this builds confidence in future Kernel uses of FixedArray
as well as its establishment in the real-time parts of the audio
subsystem. I'm excited :^)
2022-01-13 11:17:44 +01:00
kleines Filmröllchen 1d144ed6fc AK: Remove clear() from FixedArray and fixate its allocation guarantees
FixedArray always *almost* had the following allocation guarantees:
There is (possibly) one allocation in the constructor and one (or more)
deallocation(s) in the destructor. No other operation allocates or
deallocates. With this removal of the public clear() method, which
nobody except the test used anyways, those guarantees are now completely
true and furthermore fixated with an explanatory comment.
2022-01-13 11:17:44 +01:00
kleines Filmröllchen 9bf2d0b718 AK: Disable NoAllocationGuard on Lagom
Because we don't have our LibC on Lagom, the allocation guard global
flag doesn't exist and NoAllocationGuard fails to build on Lagom.
Whoops. For now, just disable NoAllocationGuard's functionality here.
2022-01-13 11:17:44 +01:00
Andreas Kling a702b6ec42 AK: Remove unnecessary null checks in RedBlackTree 2022-01-12 14:52:47 +01:00
Brian Gianforcaro 142e099001 AK: Implement StringView::for_each_split_view
StringView::for_each_split_view allows you to process the splits in a
StringView without needing to allocate a Vector<StringView> to store
each of the parts.

Since we migrated the implementation from the normal split_view path, we
can also re-implement split_view in terms of for_each_split_view.
2022-01-12 13:03:44 +01:00
Brian Gianforcaro cd42f64bc7 AK: Rewrite StringView::split_view(char..), using StringView 2022-01-12 13:03:44 +01:00
Timothy Flynn 2b5840296a AK: Add AK::Time factory method to construct from individual time fields 2022-01-11 23:56:35 +01:00
Timothy Flynn 548643bcc9 AK: Redeclare a few AK::Time helpers as constexpr
This is to allow using these methods within an upcoming constexpr
factory method.
2022-01-11 23:56:35 +01:00
Andreas Kling a4b4b358ff AK+Kernel: Remove one_ref_left() footgun
This mechanism was unsafe to use in any multithreaded context, since
the hook function was invoked on a raw pointer *after* decrementing
the local ref count.

Since we don't use it for anything anymore, let's just get rid of it.
2022-01-11 01:12:16 +01:00
Timothy Flynn 3dccaa39d8 AK: Define a traits helper for case-insensitive StringView hashing
Currently, we define a CaseInsensitiveStringTraits structure for String.
Using this structure for StringView involves allocating a String from
that view, and a second string to convert that intermediate string to
lowercase.

This defines CaseInsensitiveStringViewTraits (and the underlying helper
case_insensitive_string_hash) to avoid allocations.
2022-01-11 00:36:45 +01:00
kleines Filmröllchen 2f50d8f4d3 AK+LibC+LibPthread: Introduce NoAllocationGuard
NoAllocationGuard is an RAII stack guard that prevents allocations
while it exists. This is done through a thread-local global flag which
causes malloc to crash on a VERIFY if it is false. The guard allows for
recursion.

The intended use case for this class is in real-time audio code. In such
code, allocations are really bad, and this is an easy way of dynamically
enforcing the no-allocations rule while giving the user good feedback if
it is violated. Before real-time audio code is executed, e.g. in LibDSP,
a NoAllocationGuard is instantiated. This is not done with this commit,
as currently some code in LibDSP may still incorrectly allocate in real-
time situations.

Other use cases for the Kernel have also been added, so this commit
builds on the previous to add the support both in Userland and in the
Kernel.
2022-01-11 00:08:58 +01:00
Marcus Nilsson 4459cb33ed LibGUI+AK: Add DRAG_DEBUG opt and put drag operations behind dbgln_if
No need to have this enabled all the time.
2022-01-10 14:23:04 +01:00
Rafał Babiarz 0012c03eb5 AK: Added human_readable_time() method for "unsaved changes" dialogs 2022-01-09 20:25:48 -08:00
Stephan Unverwerth f9c5c120f6 AK/SIMD: Suppress psabi warnings and add explanatory comment 2022-01-09 21:03:08 +01:00
Stephan Unverwerth 444a15bad3 AK: Add SIMDMath.h with vectorized version of math functions 2022-01-09 16:21:13 +03:30
Stephan Unverwerth 7adcdecc7b AK: Add SIMDExtras.h with SIMD related functions
Adds a header to AK with helper functions for writing vectorized code.

Co-authored-by: Hendiadyoin <leon2002.la@gmail.com>
2022-01-09 16:21:13 +03:30
Maciej ad2551e6b8 AK: Add ByteBuffer::append(char) 2022-01-09 00:18:46 +01:00
creator1creeper1 f73afbb5ae AK: Reorder functions in FixedArray so that mutable comes before const 2022-01-08 22:54:05 +01:00
creator1creeper1 18a2685c6a AK: Reorder access in FixedArray so that m_size comes before m_elements 2022-01-08 22:54:05 +01:00
creator1creeper1 3c05261611 AK+Everywhere: Make FixedArray OOM-safe
FixedArray now doesn't expose any infallible constructors anymore.
Rather, it exposes fallible methods. Therefore, it can be used for
OOM-safe code.
This commit also converts the rest of the system to use the new API.
However, as an example, VMObject can't take advantage of this yet,
as we would have to endow VMObject with a fallible static
construction method, which would require a very fundamental change
to VMObject's whole inheritance hierarchy.
2022-01-08 22:54:05 +01:00
Andreas Kling 0e70759271 AK: Unbreak ref counting hooks in RefCounted
Same fix as 5871072ed3, but for userspace
this time. Regressed in c4a0f01b02.
2022-01-08 19:38:00 +01:00
Andreas Kling c4a0f01b02 AK+Kernel: Use requires expression when invoking ref counting hooks
Replace some old-school template trickery with C++20 requires. :^)
2022-01-08 16:31:14 +01:00
mjz19910 10ec98dd38 Everywhere: Fix spelling mistakes 2022-01-07 15:44:42 +01:00
Schlufi 55a7738837 AK: Use a full-period xorshift PRNG for double_hash
The previous implementation had some pretty short cycles and two fixed
points (1711463637 and 2389024350). If two keys hashed to one of these
values insertions and lookups would loop forever.
This version is based on a standard xorshift PRNG with period 2**32-1.
The all-zero state is usually forbidden, so we insert it into the cycle
at an arbitrary location.
2022-01-07 12:34:44 +01:00
mjz19910 3102d8e160 Everywhere: Fix many spelling errors 2022-01-07 10:56:59 +01:00
Timothy Flynn bb9db5937a AK: Add Time.h helper to compute the number of days since epoch 2022-01-05 20:05:12 +01:00
Timothy Flynn 0c75a14b4f AK: Move TimeSpecType concept inside the AK namespace
This is just to allow removing the 'clang-format off' directive. This
concept is only used within this header, so it doesn't need to be in the
global namespace.
2022-01-05 20:05:12 +01:00
Andreas Kling 558fb0a04a AK: Make Vector::remove_all_matching() return removal success
This matches the behavior of other remove_*_matching() functions.
2022-01-05 18:57:14 +01:00
Andreas Kling 5279a04c78 AK: Make Hash{Map,Table}::remove_all_matching() return removal success
These functions now return whether one or more entries were removed.
2022-01-05 18:57:14 +01:00
Andreas Kling 376e5ef912 AK: Add HashMap::remove_all_matching(predicate)
This removes all matching entries from a hash map in a single pass.
2022-01-05 18:57:14 +01:00
Andreas Kling 54cf42fac1 AK: Add HashTable::remove_all_matching(predicate)
This removes all matching entries from a table in a single pass.
2022-01-05 18:57:14 +01:00
Brian Gianforcaro 1a2aad287f AK: Disable Vector insert/empend/prepend + a append overload in Kernel
We have whittled away at the usages of these AK::Vector APIs in the
Kernel. This change disables them from being visible when building
the Kernel to make sure no new usages get added.
2022-01-05 14:04:18 +01:00
Brian Gianforcaro 48206be121 AK: Use MUST + try_empend so AK::Trie continues to compile in the kernel 2022-01-05 14:04:18 +01:00
Brian Gianforcaro 7d27798c8d AK: Use unchecked_append in AK::Stack, as we always validate the size
This removes one additional usage of Vector::append that stops us from
disabling it when compiling the Kernel.
2022-01-05 14:04:18 +01:00
Jelle Raaijmakers 8da0925d6d AK: Add mix 2022-01-04 17:48:28 +00:00
B0IIZZ 6124050187 AK: Fix UFixedBigInt comparison operators
Instead of using the specified type U like we want,
we were using the type T all along when comparing with
smaller integers. This is now fixed.
2022-01-04 06:01:22 +00:00
James Puleo 5b164e9934 AK: Include utility from the STD if we aren't replacing STD
If we didn't define our own `move` and `forward` and inject it into the
`std` namespace, then we would error just after trying to `using` those,
if no one has included it before. Now, we will include `utility` from
the STD if we aren't replacing the `std`.
2022-01-02 12:05:12 +01:00
Daniel Bertalan 1d2f78682b Kernel+AK: Eliminate a couple of temporary String allocations 2021-12-30 14:16:03 +01:00
Andreas Kling ac7ce12123 Kernel: Remove the kmalloc_eternal heap :^)
This was a premature optimization from the early days of SerenityOS.
The eternal heap was a simple bump pointer allocator over a static
byte array. My original idea was to avoid heap fragmentation and improve
data locality, but both ideas were rooted in cargo culting, not data.

We would reserve 4 MiB at boot and only ended up using ~256 KiB, wasting
the rest.

This patch replaces all kmalloc_eternal() usage by regular kmalloc().
2021-12-28 21:02:38 +01:00
Andreas Kling 1c2aa7396d AK: Don't include AK::demangle() in KERNEL builds
This was not used anywhere in the kernel anyway.
2021-12-26 21:22:59 +01:00
Andreas Kling 8a51f64503 AK: Increase StringBuilder's inline buffer size from 128 to 256 bytes 2021-12-26 01:42:58 +01:00
Ali Mohammad Pur 986d63466e AK: Remove Variant<Ts...>::operator Variant<NewTs...>()
This is an interface to downcast(), which degrades errors into runtime
errors, and allows seemingly-correct-but-not-quite constructs like the
following to appear to compile, but fail at runtime:

    Variant<NonnullRefPtr<T>, U> foo = ...;
    Variant<RefPtr<T>, U> bar = foo;

The expectation here is that `foo` is converted to a RefPtr<T> if it
contains one, and remains a U otherwise, but in reality, the
NonnullRefPtr<T> variant is simply dropped on the floor, and the
resulting variant becomes invalid, failing the assertion in downcast().

This commit adds a Variant<Ts...>(Variant<NewTs...>) constructor that
ensures that no alternative can be left out at compiletime, for the
users that were using this interface for merely increasing the number of
alternatives (for instance, LibSQL's Value class).
2021-12-25 18:24:43 +03:30
Daniel Bertalan 2b1864c53a AK: Add missing Array.h include to CheckedFormatString.h
GCC 12 complains that iota_array is used before it's declared. GCC 11
works fine without it though.
2021-12-24 14:35:33 -08:00
Michel Hermier 4758dac218 AK: Make Disjoint*::is_empty() not call size
This is a raffinement of 49cbd4dcca.

Previously, the container was scanned to compute the size in the unhappy
path. Now, using `all_of` happy and unhappy path should be fast.
2021-12-24 05:55:34 -08:00
Michel Hermier 3a177b9209 AK: Add DisjointChunkc::ensure_capacity 2021-12-24 05:55:34 -08:00
Nick Johnson 08e4a1a4dc AK+Everywhere: Replace __builtin bit functions
In order to reduce our reliance on __builtin_{ffs, clz, ctz, popcount},
this commit removes all calls to these functions and replaces them with
the equivalent functions in AK/BuiltinWrappers.h.
2021-12-21 22:13:51 +01:00
Xavier Defrang 9e97823ff8 AK: Add convert_to_uint_from_octal 2021-12-21 13:13:04 -08:00
Ali Mohammad Pur 49cbd4dcca AK: Make DisjointChunks not query size() when there are no chunks 2021-12-21 22:10:07 +01:00
Ali Mohammad Pur 2df54a7b56 AK: Add Disjoint(Chunks Spans)::find(index)
For when the may or may not be out of bounds.
2021-12-21 22:10:07 +01:00
Ali Mohammad Pur f0709c7a24 LibC+AK: Implement all sorts of wprintf variants 2021-12-21 21:24:36 +03:30
Andreas Kling 452a5531be AK+LibMain: Improve formatter for AK::Error in userspace
Print the full associated string metadata by default (if available.)
2021-12-20 21:13:42 +01:00
Nick Johnson e122502f70 AK: Speed up BitmapView::find_next_range_of_unset_bits
While watching Andreas' most recent video, I noticed that this function
only worked with 32 bit values, but was a serious performance
bottleneck for the kernel. As such, I reworked it to use `size_t`, so
it now can switch to 64-bit sweeps on 64-bit platforms. This caused
test-js to go from 12.5 seconds hot to 11.5 seconds hot on my machine
when running on KVM x86_64.
2021-12-18 23:36:08 +01:00
Nick Johnson 548529ace4 AK: Add BuiltinWrappers.h
The goal of this file is to enable C++ overloaded functions for
standard builtin functions that we use. It contains fallback
implementations for systems that do not have the builtins available.
2021-12-18 23:36:08 +01:00
kleines Filmröllchen 3891d6d73a AK: Fast path for single-element TypedTransfer::copy
Co-Authored-By: Brian Gianforcaro <bgianf@serenityos.org>
2021-12-17 13:13:00 -08:00
kleines Filmröllchen d5dce448ea AK: Bypass Buffered's buffer for large reads
Before, if we couldn't read enough data out of the buffer, we would re-
fill the buffer and recursively call read(), which in turn reads data
from the buffer into the resliced target span. This incurs very
intensive superflous memmove's when large chunks of data are read from
a buffered stream.

This commit changes the behavior so that when we exhaust the buffer, we
first read any necessary additional data directly into the target, then
fill up the buffer again. Effectively, this results in drastically
reduced overhead from Buffered when reading large contiguous chunks.
Of course, Buffered is designed to speed up data access patterns with
small frequent reads, but it's nice to be able to combine both access
patterns on one stream without penalties either way.

The final performance gain is about an additional 80% of abench decoding
speed.
2021-12-17 13:13:00 -08:00
Andreas Kling a409b832fa AK: Make JsonValue::from_string("") return a null JsonValue
This unbreaks the /var/run/utmp system which starts out as an empty
string, and is then turned into an object by the first update.

This isn't necessarily the best way for this to work, but it's how
it used to work, so this just fixes the regression for now.
2021-12-16 22:48:17 +01:00
sin-ack 69ef211925 Kernel+LibC: Move errno definitions to Kernel/API/POSIX
This fixes at least half of our LibC includes in the kernel. The source
of truth for errno codes and their description strings now lives in
Kernel/API/POSIX/errno.h as an enumeration, which LibC includes.
2021-12-16 22:21:35 +03:30
sin-ack e4a1bc1542 AK: Use __builtin_memmove for ByteBuffer and Span's overwrite
__builtin_memcpy will fail when the target area and the source area
overlap. Using __builtin_memmove will handle this case as well.
2021-12-16 22:21:35 +03:30
Ben Wiederhake 208d85e707 AK+Tests: Use less space in ErrorOr 2021-12-16 09:32:51 +01:00
Hendiadyoin1 c673b7220a AK: Enable fast path for removal by hash-compatible key in HashMap/Table 2021-12-15 23:35:14 -08:00
Hendiadyoin1 b429f9c7aa AK: Add implied const qualifiers to the Json interface
As specified by clang-tidy.
2021-12-15 23:35:14 -08:00
Hendiadyoin1 b39c4c62d0 AK: Use StringView as key-type when removing a Value from an JsonObject 2021-12-15 23:35:14 -08:00
Hendiadyoin1 e35709cbd2 AK: Return bool in JsonValue::as_bool() 2021-12-15 23:35:14 -08:00
Andrew Kaster db33cdbc2f AK+LibSanitizer: Add method to zero out a UBSAN SourceLocation
This is the same strategy that LLVM's compiler-rt uses to make sure that
each UBSAN error is only reported once, when UBSAN is *not* deadly.

Otherwise, each time we head through a UB codepath, we will log the same
error over and over. That behavior just adds noise to the logs and makes
it nearly impossible to run binaires that have some common code path
with flagged UB in them.

compiler-rt goes the extra step to make sure the "clear" action is
atomic, but we don't really have that many multi-threaded apps gettting
tested with UBSAN yet, so we can add that later.
2021-12-15 10:30:32 -08:00
Hendiadyoin1 422b624743 AK: Convert JsonObject to use StringViews for lookup
Most of the Keys we use are compile-time strings anyway, there is no
need to use the heap to pass them around.
2021-12-15 13:09:49 +03:30
Hendiadyoin1 d50360f5dd AK: Allow hash-compatible key types in Hash[Table|Map] lookup
This will allow us to avoid some potentially expensive type conversion
during lookup, like form String to StringView, which would allocate
memory otherwise.
2021-12-15 13:09:49 +03:30
Hendiadyoin1 c8bee92fb9 AK: Add the concept of hash-compatible types 2021-12-15 13:09:49 +03:30
Hendiadyoin1 92e824afa1 AK: Add a Concept for any String type 2021-12-15 13:09:49 +03:30
Hendiadyoin1 6c6e917cf0 AK: Add dedicated Traits for c-strings 2021-12-15 13:09:49 +03:30
Hendiadyoin1 ceb0e28ea5 AK: Add helper to test for pointer and cv-pointer at the same time 2021-12-15 13:09:49 +03:30