Age | Commit message (Collapse) | Author |
|
Unlike String/StringView::starts_with this compares utf8 code points
instead of "characters" (bytes), which is important when handling
aribtary utf-8 input that could include overlong characters.
|
|
Wraps the existing AK::human_readable_size function but will always
display the bytes in the base unit as well as the shorter string with
one decimal. E.g. "14 KiB (14396 bytes)".
|
|
|
|
|
|
Alot of code is shared between i386/i686/x86 and x86_64
and a lot probably will be used for compatability modes.
So we start by moving the headers into one Directory.
We will probalby be able to move some cpp files aswell.
|
|
We were using u32 as a pointer representation and not FlatPtr
|
|
It was for some reason Architecture dependent.
Now we use size_t instead of unsinged long
|
|
This will be used to fix the UHCI Controller, which relies on
the pointer-size being 32-bit
|
|
|
|
|
|
This makes GCC emit warnings about redundant and pessimizing moves.
It also allows static analyzers like clang-tidy to detect common bugs
like use-after-move.
|
|
|
|
|
|
In the case that both the stream and the wrapped substream had errors
to be handled only one of the two would be resolved due to boolean
short circuiting. this commit ensures both are handled irregardless
of one another.
|
|
This ensures that when a DeflateCompressor stream is cleared of any
errors its underlying wrapped streams (InputBitStream/InputMemoryStream)
will be cleared as well and wont fail a VERIFY on destruction.
|
|
If you want the whole buffer, we can just give you the buffer itself.
|
|
If the bit write is aligned (or has been aligned during the write) we can
write in multiples of 32/16/8 bits for increased performance.
|
|
The 2 seperate key and value arrays are replaced with a single struct pair
array that allows for a 2x reduction in loads/stores during element swaps
in the common case of same-sized keys and values.
|
|
This enables efficient implementations of priority queues,
and will also be used in LibCompress for efficient huffman
tree generation.
|
|
This will be used in the deflate compressor.
|
|
Based on #5699. Closes #5699.
|
|
|
|
|
|
Good-bye LogStream. Long live AK::Format!
|
|
|
|
|
|
|
|
operations
This change introduces `AK_ENUM_BITWISE_OPERATORS(..)` which when
enabled for an enum, will automatically declare all the necessary
bitwise operators for that enum.
This allows bit masks enums to be used as first class, type safe, citizens.
|
|
By making the Time constructor constexpr we can optimize creating a
Time instance from hardcoded values.
Also add more functions to convert between Time and various time units.
|
|
Since we tell the compiler to provide a default constructor we
need to initialize the member variables.
|
|
|
|
As expected, Checked<unsigned> works as intended. However, we didn't have a
test for that, so I added one.
See also 90c070cb1d90d77ba461017e609b9f8ee6326de1.
|
|
Now that we use fragment for specifying starting selection in
FileManager we would benefit from providing it as argument instead of
setting it each time separately.
|
|
I needed these meta-programming type traits while working on something else.
Add basic support for these two type traits as well as some tests.
|
|
We use atomic_signal_fence and atomic_thread_fence together to prevent
reordering of memory accesses by the CPU and the compiler.
The usage of these functions was suggested by @tomuta so we can be sure
that important memory accesses happen in the expected order :)
|
|
Add Bitmap::view() and forward most of the calls to BitmapView since
the code was identical.
Bitmap is now primarily concerned with its dynamically allocated
backing store and BitmapView deals with the rest.
|
|
AK::Bitmap is an awkwardly modal class which can either own or wrap
the underlying data. To get ourselves out of this unpleasant situation,
this patch adds BitmapView to replace the wrapped mode.
A BitmapView is simply a { data pointer, bit count } tuple internally
and provides all the convenient functionality of a bitmap class.
|
|
This makes them available for use by other language servers.
Also as a bonus, update the Shell language server to discover some
symbols and add go-to-definition functionality :^)
|
|
Mostly due to the fact that clang-format allows aligned comments via
AlignTrailingComments.
We could also use raw string literals in inline asm, which clang-format
deals with properly (and would be nicer in a lot of places).
|
|
This class has a null state but there was no API to check for it.
|
|
This was added as clang-format would mess up the formatting when using
[[nodiscard]] on a class, which is no longer the case.
|
|
|
|
|
|
"!=" has higher priority than "=".
|
|
|
|
These structs can be inconsistent, for example if the amount of microseconds is
negative or larger than 1'000'000. Therefore, they should not be copied as-is.
Use copy_time_from_user instead.
|
|
This adds a bunch of code in the hope that other, wrong code can be deleted.
Related to #5315.
|
|
|
|
|
|
This allows us to remove the FAIL_REGEX logic from the CTest invocation
of AK and LibRegex tests, as they will return a non-zero exit code on
failure :^).
Also means that running a failing TestSuite-enabled test with the
run-test-and-shutdown script will actually print that the test failed.
|