summaryrefslogtreecommitdiff
path: root/AK
AgeCommit message (Collapse)Author
2020-07-09AK: HashTable/HashMap return whether action was performed for set/removeTom
This allows performing an action based on whether something was actually added or removed without having to look it up prior to calling set() or remove().
2020-07-06AK: Fix JsonValue copy constructor behavior for 64-bit valuesAndreas Kling
The fact that JsonValues can contain 64-bit values isn't a JavaScript compatible behavior in the first place, but as long as we're supporting this, we should make sure it works correctly.
2020-07-05AK: Remove debug spam in SharedBuffer::create_from_shbuf_id()Andreas Kling
2020-07-05AK: Make Vector::unstable_remove() return the removed valueSergey Bugaev
...and rename it to unstable_take(), to align with other take...() methods.
2020-07-04Kernel: Move headers intended for userspace use into Kernel/API/Andreas Kling
2020-07-04AK: Add Weakable::revoke_weak_ptrs()Andreas Kling
This allows you to clear all the WeakPtrs pointing at a Weakable *now* instead of waiting until the Weakable is destroyed.
2020-07-03AK: Serialize entire log statementsTom
Prior to this, we wrote to the log every time the << operator was used, which meant that only these parts of the log statement were serialized. If the thread was preempted, or especially with multiple CPUs the debug output was hard to decipher. Instead, we buffer up the log statements. To avoid allocations we'll attempt to use stack space, which covers most log statements.
2020-07-03AK: Fixes for atomic pointersTom
2020-07-01Kernel: Turn Thread::current and Process::current into functionsTom
This allows us to query the current thread and process on a per processor basis
2020-07-01Inspector: Expand and show properties in a TreeViewAnotherTest
This allows the inspector to show arbitrary json structures.
2020-06-23AK: Inline the basics of VectorIteratorAndreas Kling
Inlining these allows the compiler to optimize out the assertions in favor of a static range check in many cases.
2020-06-22AK: Add timespec_add and timespec_subNico Weber
2020-06-20AK: Fix JsonParser double encoding multibyte utf-8 chararctersLepkoQQ
2020-06-18AK: Add tests for Base64 decoderTom Lebreux
2020-06-18AK: Add a simple and inefficient Base64 encoderTom Lebreux
The test cases are taken from RFC 4648.
2020-06-16AK: Implement a slightly better FlyString::operator==(String)Andreas Kling
This was showing up in Browser profiles, which is silly, so write a new version that doesn't create a temporary String object. There are a whole bunch of these and long-term it would be nice to find a way to share all the very similar logic instead of duplicating it.
2020-06-16Test: Fix json parse test from unicode stringHüseyin ASLITÜRK
2020-06-16AK: JsonParser, replace char type to u32 for code pointHüseyin ASLITÜRK
2020-06-15AK: Assert non-empty Utf32View, when initialized with non-zero lengthKevin Meyer
This was useful in debugging a nullptr dereference, which was happening through later, but was caused by this inconsistent initialization.
2020-06-13AK: JsonParser improvementsMatthew Olsson
- Parsing invalid JSON no longer asserts Instead of asserting when coming across malformed JSON, JsonParser::parse now returns an Optional<JsonValue>. - Disallow trailing commas in JSON objects and arrays - No longer parse 'undefined', as that is a purely JS thing - No longer allow non-whitespace after anything consumed by the initial parse() call. Examples of things that were valid and no longer are: - undefineddfz - {"foo": 1}abcd - [1,2,3]4 - JsonObject.for_each_member now iterates in original insertion order
2020-06-12AK: Make string-to-number conversion helpers return OptionalAndreas Kling
Get rid of the weird old signature: - int StringType::to_int(bool& ok) const And replace it with sensible new signature: - Optional<int> StringType::to_int() const
2020-06-12AK: Remove useless castsSergey Bugaev
2020-06-12AK: Ensure RefCounted types are never copied or movedSergey Bugaev
Before this, it has been possible to assign a RefCounted object to another RefCounted object. Hilariosly (or sadly), that copied the refcount among the other fields, meaning the target value ended up with a wrong refcount. Ensure this never happens by disallowing copies and moves for RefCounted types.
2020-06-12AK: Assert refcount doesn't overflowSergey Bugaev
We don't really have a good way to prevent this kind of overflow, but let's at least immediately panic in this case.
2020-06-12AK: Switch RefCounted to atomic refcountingSergey Bugaev
This fixes all sorts of race conditions, primarily in the kernel, where till now it's been possible to obtain either double free or use-after-free by exploiting refcounting races.
2020-06-12AK: Use unsigned int for refcountSergey Bugaev
And while fixing all the tests that look at ref_count(), sneak in a fix for the test suite name.
2020-06-12AK: Ensure we never use OwnPtr<> with RefCounted typesSergey Bugaev
2020-06-12AK: ALWAYS_INLINE most Atomic<T> methodsSergey Bugaev
2020-06-12AK: Fix missing ptrdiff_t in non-Serenity buildsSergey Bugaev
We have to include <stddef.h> to get its definition.
2020-06-10AK: URL should urldecode data: URL payloadsAndreas Kling
Otherwise we can end up with percent-encoded nonsense in base64 data which does not decode correctly.
2020-06-07AK: Add basic percent encoder/decoder (urlencode and urldecode)Andreas Kling
2020-06-07AK: Add StringView::{begin,end} so we can range-for over StringViewsAndreas Kling
2020-06-07AK: Don't try to complete relative data: URLsAndreas Kling
2020-06-06AK: Fix printf("%c", 0)Sergey Bugaev
It was me who has broken this, sorry ;(
2020-06-04AK: Allow default-constructing Utf8View and Utf8CodepointIteratorAndreas Kling
2020-06-04AK: Add StringBuilder::append_codepoint(u32)Andreas Kling
Also, implement append(Utf32View) using it.
2020-06-04AK: Add atomic free functionsTom
This allows for using atomic operations on any variables, not only those wrapped in AK::Atomic<T>
2020-06-03AK: JSON, Escape spacial character in string serializationHüseyin ASLITÜRK
2020-06-01AK: Add operator== and hash traits for URLAndreas Kling
2020-05-31AK: Always inline some Checked methodsSergey Bugaev
Once again, we need to hint the compiler that it should inline the function, and then it is able to eliminate the assertion.
2020-05-30AK: Make some StringView constructors constexprAndreas Kling
2020-05-30AK+LibC: Add TODO() as an alternative to ASSERT_NOT_REACHED()Andreas Kling
I've been using this in the new HTML parser and it makes it much easier to understand the state of unfinished code branches. TODO() is for places where it's okay to end up but we need to implement something there. ASSERT_NOT_REACHED() is for places where it's not okay to end up, and something has gone wrong.
2020-05-30AK: Make {String,FlyString}::is_one_of() constAndreas Kling
Also, make the zero-argument variant private since it's not meant to be called by clients directly.
2020-05-30Lagom: Adjust AK, LibCore and LibTLS to build on MacOSMarcin Gasperowicz
2020-05-29Ports: Fix CMake-based portsPaul Redmond
The SDL port failed to build because the CMake toolchain filed pointed to the old root. Now the toolchain file assumes that the Root is in Build/Root. Additionally, the AK/ and Kernel/ headers need to be installed in the root too.
2020-05-29Meta: Add a script check the presence of "#pragma once" in header filesEmanuele Torre
.. and make travis run it. I renamed check-license-headers.sh to check-style.sh and expanded it so that it now also checks for the presence of "#pragma once" in .h files. It also checks the presence of a (single) blank line above and below the "#pragma once" line. I also added "#pragma once" to all the files that need it: even the ones we are not check. I also added/removed blank lines in order to make the script not fail. I also ran clang-format on the files I modified.
2020-05-28AK: Add StringView::split_view() taking a StringViewAnotherTest
Since the task of splitting a string via another is pretty common, we might as well have this overload of split_view() as well.
2020-05-27AK: Add a simple randomness APIAndreas Kling
This can be used in code that builds on non-Serenity platforms.
2020-05-26AK: Mark some popular String member functions ALWAYS_INLINEAndreas Kling
I don't wanna see String::length() in a profile, jeez. :^)
2020-05-26AK: Rename FileSystemPath -> LexicalPathSergey Bugaev
And move canonicalized_path() to a static method on LexicalPath. This is to make it clear that FileSystemPath/canonicalized_path() only perform *lexical* canonicalization.