summaryrefslogtreecommitdiff
path: root/AK
AgeCommit message (Collapse)Author
2021-03-25AK: Add starts_with to Utf8ViewIdan Horowitz
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.
2021-03-25AK: Add longer human readable size to string helper functionDavid Isaksson
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)".
2021-03-23LibGUI: Remove one ancient GMENU_DEBUG debug logAndreas Kling
2021-03-23AK: Implement bit_castOleg Sikorskiy
2021-03-21Kernel::CPU: Move headers into common directoryHendiadyoin1
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.
2021-03-21AK+LibC: Make %p specifier Architecture IndependentHendiadyoin1
We were using u32 as a pointer representation and not FlatPtr
2021-03-21AK: Fix integer_sequence_generate_arrayHendiadyoin1
It was for some reason Architecture dependent. Now we use size_t instead of unsinged long
2021-03-21AK: Add a Ptr32 type to handle fixed sized pointersHendiadyoin1
This will be used to fix the UHCI Controller, which relies on the pointer-size being 32-bit
2021-03-17AK: Implement terabytes, petabytes, exabytesJean-Baptiste Boric
2021-03-17AK: Add 64 bit methods to JsonValueJean-Baptiste Boric
2021-03-17AK: Move move() into the "std" namespaceAndreas Kling
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.
2021-03-17Everywhere: Remove pessimizing and redundant move()Andreas Kling
2021-03-17AK: Tests: TestURL: Add port_int_overflow_wrap testBrendan Coles
2021-03-16LibCompress+AK: Dont short-circuit error handling propagationIdan Horowitz
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.
2021-03-15LibCompress+AK: Propagate error handling to wrapped streamsIdan Horowitz
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.
2021-03-15AK: Make ByteBuffer::slice(0, size()) a freebieAndreas Kling
If you want the whole buffer, we can just give you the buffer itself.
2021-03-13AK: Add fast paths for aligned bit writes in BitOutputStreamIdan Horowitz
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.
2021-03-13AK: Store BinaryHeap key-value pairs together for efficient swapsIdan Horowitz
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.
2021-03-13AK: Implement minimum BinaryHeapIdan Horowitz
This enables efficient implementations of priority queues, and will also be used in LibCompress for efficient huffman tree generation.
2021-03-13AK: Add OutputBitStream classIdan Horowitz
This will be used in the deflate compressor.
2021-03-13AK: Fix some overflows/underflows that weren't properly handledBen Wiederhake
Based on #5699. Closes #5699.
2021-03-13AK: Add decrement operator to CheckedTom
2021-03-12AK+LibCore: Remove empty filesAndreas Kling
2021-03-12Everywhere: Remove klog(), dbg() and purge all LogStream usage :^)Andreas Kling
Good-bye LogStream. Long live AK::Format!
2021-03-11AK: Add basic const iteration to IntrusiveListAndreas Kling
2021-03-09AK: Add Formatter for RefPtrAndreas Kling
2021-03-09AK: Include Assertions.h in StdLibExtras.hMițca Dumitru
2021-03-08AK: Add AK_ENUM_BITWISE_OPERATORS(..) to enable type-safe enum bitwise ↵Brian Gianforcaro
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.
2021-03-08AK: Take advantage of constexpr in Time and add time conversion methodsTom
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.
2021-03-08AK: Initialize the AK::Time membersTom
Since we tell the compiler to provide a default constructor we need to initialize the member variables.
2021-03-08AK: JsonObject::value_or() fallback value should be a const referenceAndreas Kling
2021-03-07AK+Tests: Also test Checked<> with unsignedBen Wiederhake
As expected, Checked<unsigned> works as intended. However, we didn't have a test for that, so I added one. See also 90c070cb1d90d77ba461017e609b9f8ee6326de1.
2021-03-07AK: Add optional fragment parameter to create_with_file_protocol()speles
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.
2021-03-05AK: Implement IsEnum<T> and UnderlyingType<T> type traitsBrian Gianforcaro
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.
2021-03-05AK: Add a full memory barrier function based on atomic operationsLiav A
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 :)
2021-03-04AK: Simplify Bitmap and implement in terms of BitmapViewAndreas Kling
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.
2021-03-04AK: Add BitmapView class (like StringView but for bitmaps)Andreas Kling
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.
2021-03-04HackStudio/LanguageServers: Move some components out of CppAnotherTest
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 :^)
2021-03-04Everywhere: Remove unnecessary `clang-format off`sWilliam McPherson
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).
2021-03-04AK: Add Bitmap::is_null()Andreas Kling
This class has a null state but there was no API to check for it.
2021-03-03AK+Kernel: Remove NO_DISCARD macro hackLinus Groh
This was added as clang-format would mess up the formatting when using [[nodiscard]] on a class, which is no longer the case.
2021-03-03AK+LibM: Rename EXPECT_CLOSE to EXPECT_APPROXIMATEBen Wiederhake
2021-03-03AK+LibM: Make EXPECT_CLOSE more useful during debuggingBen Wiederhake
2021-03-03AK: Fix OOO mistake in StackInfo.cppihsinme
"!=" has higher priority than "=".
2021-03-02AK: Make Time more usableBen Wiederhake
2021-03-02Kernel: Prevent using copy_from_user() for timespec/timevalBen Wiederhake
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.
2021-03-02AK: Implement C++ 'Time' type for easier time-calculationsBen Wiederhake
This adds a bunch of code in the hope that other, wrong code can be deleted. Related to #5315.
2021-03-02AK: Remove unused templateBen Wiederhake
2021-03-02AK+Tests: Test Checked for main functionalityBen Wiederhake
2021-03-01AK/Lagom: Modify TestSuite to return how many tests failed from mainAndrew Kaster
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.