summaryrefslogtreecommitdiff
path: root/AK
AgeCommit message (Collapse)Author
2019-11-09HackStudio: Start fleshing out the GUI for a GUI designer :^)Andreas Kling
I'll be reconstructing parts of the VisualBuilder application here and then we can retire VisualBuilder entirely once all the functionality is available in HackStudio.
2019-11-07AK: Add Vector::take(index)Andreas Kling
This removes an item from the vector and returns it.
2019-11-07AK: Delete operator!() and operator bool() from the Nonnull pointersAndreas Kling
Since NonnullRefPtr and NonnullOwnPtr cannot be null, it is pointless to convert them to a bool, since it would always be true. This patch makes it an error to null-check one of these pointers.
2019-11-07AK: Add Vector::prepend(T&&)Andreas Kling
2019-11-06AK: Always rebuild unit tests if AK headers changeAndreas Kling
This is a hack to avoid failing AK unit tests because it didn't even try to rebuild.
2019-11-06AK: Remove unused AK::not_implemented()Andreas Kling
Whatever this was supposed to be, it was ironically... not implemented.
2019-11-06LibELF: Move AK/ELF/ into Libraries/LibELF/Andreas Kling
Let's arrange things like this instead. It didn't feel right for all of the ELF handling code to live in AK.
2019-11-06AK: Get rid of TStyle (output styling helper for LogStream)Andreas Kling
This didn't end up getting used, so let's get rid of it.
2019-11-04AK: Let's just log unimplemented printf() format stringsAndreas Kling
It's too dang frustrating that we actually crash whenever we hit some unimplemented printf specifier. Let's just log the whole format string and carry on as best we can.
2019-11-03AK: Allow overriding the Queue segment size with a template parameterAndreas Kling
2019-11-03AK: Add Queue::head()Andreas Kling
This returns a const T& for the first element in the queue, without dequeuing it.
2019-11-02AK: Handle '%llu' in printf() (unsigned 64-bit integer)Andreas Kling
I got a warning when using '%Q' since that's non-standard. This patch makes our printf family accept '%llu'.
2019-10-29AK: Allow JsonValue to store 64-bit integers internallyAndreas Kling
Add dedicated internal types for Int64 and UnsignedInt64. This makes it a bit more straightforward to work with 64-bit numbers (instead of just implicitly storing them as doubles.)
2019-10-28AK: Add String::contains(String)Andreas Kling
This is just a wrapper around strstr() for now. There are many better ways to search for a string within a string, but I'm just adding a nice API at the moment. :^)
2019-10-23AK: Add JsonArray::ensure_capacity()Andreas Kling
This is helpful for anyone who knows up-front how many items are gonna be appended to the JsonArray.
2019-10-23AK: Make it possible to store complex types in a CircularQueueAndreas Kling
Previously we would not run destructors for items in a CircularQueue, which would lead to memory leaks. This patch fixes that, and also adds a basic unit test for the class.
2019-10-21URL: https:// URLs should default to port 443Andreas Kling
2019-10-21JsonObject: Add JsonObject::has(key)Andreas Kling
2019-10-21URL: Unbreak the serialization testAndreas Kling
http:// URLs no longer include ":80" when serialized, since port 80 is implied by the protocol. Non-standard ports are still serialized.
2019-10-20ELF: Fail layout when program header hooks return nullptr (#673)Andrew Kaster
ELFLoader::layout() had a "failed" variable that was never set. This patch checks the return value of each hook (alloc/map section and tls) and fails the load if they return null. I also needed to patch Process so that the alloc_section_hook and map_section_hook actually return nullptr when allocating a region fails. Fixes #664 :)
2019-10-20AK: Add CircularDeque.Drew Stratford
This class inherits from CircularQueue and adds the ability dequeue from the end of the queue using dequeue_end(). Note that I had to make some of CircularQueue's fields protected to properly implement dequeue_end.
2019-10-19String: Define operator>(String)Andreas Kling
2019-10-18UTF-8: Add Utf8CodepointIterator::codepoint_length_in_bytes()Andreas Kling
This allows you to retrieve the length (in bytes) of the codepoint the iterator is currently pointing at.
2019-10-18AK: Add String::hash()Andreas Kling
2019-10-17URL: Parse URLs that lack a path (e.g "http://serenityos.org")Andreas Kling
2019-10-12AK: Add Atomic.hTom
Use gcc built-in atomics
2019-10-10URL: No need to include ":80" when serializing http:// URLsAndreas Kling
2019-10-07AK: Make String compile on platforms where size_t==u32Andreas Kling
This kind of thing is a bit annoying. On Serenity, size_t is the same size as u32, but not the same type. Because of "long" or whatever. This patch makes String not complain about duplicate overloads.
2019-10-05AK: URL should support file:// URL'sAndreas Kling
Also add some setters since this class was very setter-less.
2019-10-01AK: Make Bitmap constructors public to allow make<Bitmap>()Andreas Kling
I don't love this, but I also don't love the Bitmap class in general.
2019-10-01AK: Remove empty files JsonArray.cpp and JsonObject.cppAndreas Kling
2019-09-30ByteBuffer: Remove pointer() in favor of data()Andreas Kling
We had two ways to get the data inside a ByteBuffer. That was silly.
2019-09-29AK: Add StringBuilder::length() and trim(int)Andreas Kling
Sometimes you want to trim a byte or two off the end.
2019-09-28AK: Add StringBuilder::string_view() and StringBuilder::clear()Sergey Bugaev
The former allows you to inspect the string while it's being built. It's an explicit method rather than `operator StringView()` because you must remember you can only look at it in between modifications; appending to the StringBuilder invalidates the StringView. The latter lets you clear the state of a StringBuilder explicitly, to start from an empty string again.
2019-09-28AK: Add a keep_empty argument to String[View]::substring{_view}Sergey Bugaev
2019-09-27Kernel: Make Region single-owner instead of ref-countedAndreas Kling
This simplifies the ownership model and makes Region easier to reason about. Userspace Regions are now primarily kept by Process::m_regions. Kernel Regions are kept in various OwnPtr<Regions>'s. Regions now only ever get unmapped when they are destroyed.
2019-09-27ELF: Make code a little more buildable on other platformsAndreas Kling
Patch from Anonymous.
2019-09-22AK: Add AK_MAKE_NONMOVABLEAndreas Kling
2019-09-16Kernel: Move kmalloc() into a Kernel/Heap/ directoryAndreas Kling
2019-09-15Utf8View: Don't print potentially unterminated string in debug messageAndreas Kling
2019-09-13Revert "AK: Made Strings reversible"Andreas Kling
This reverts commit 26e81ad574d463faee19f5973108f80d0e02aaf6. We forgot to consider UTF-8 here. String is UTF-8 and we need to be careful about things like this.
2019-09-13AK: Made Strings reversibleJesse Buhagiar
`AK::String` can now be reversed via AK::String::reverse(). This makes life a lot easier for functions like `itoa()`, where the output ends up being backwards. Very much not like the normal STL (which requires an `std::reverse` object) way of doing things. A call to reverse returns a new `AK::String` so as to not upset any of the possible references to the same `StringImpl` shared between Strings.
2019-09-13TestStringView: Add test for starts_withMinusGix
2019-09-13StringView: Add starts_with methodMinusGix
2019-09-11printf: %w, %b, and %p should be zero-padded but not left-paddedAndreas Kling
This fixes the goofy issue with %p coming out as " 0x123" instead of "0x00000123".
2019-09-11AK: Add LogStream operator<< for ByteBufferAndreas Kling
2019-09-11AK: Add String::number(size_t) overloadAndreas Kling
2019-09-08AK: Fix buffer overrun in Utf8CodepointIterator::operator++Sergey Bugaev
The old implementation tried to move forward as long as the current byte looks like a UTF-8 character continuation byte (has its two most significant bits set to 10). This is correct as long as we assume the string is actually valid UTF-8, which we do (we also have a separate method that can check whether it is the case). We can't, however, assume that the data after the end of our string is also valid UTF-8 (in fact, we're not even allowed to look at data outside out string, but it happens to a valid memory region most of the time). If the byte after the end of our string also has its most significant bits set to 10, we would move one byte forward, and then fail the m_length > 0 assertion. One way to fix this would be to add a length check inside the loop condition. The other one, implemented in this commit, is to reimplement the whole function in terms of decode_first_byte(), which gives us the length as encoded in the first byte. This also brings it more in line with the other functions around it that do UTF-8 decoding.
2019-09-08AK: Pad %b and %w to two and four places in printfConrad Pankoff
2019-09-07Kernel: Support thread-local storageAndreas Kling
This patch adds support for TLS according to the x86 System V ABI. Each thread gets a thread-specific memory region, and the GS segment register always points _to a pointer_ to the thread-specific memory. In other words, to access thread-local variables, userspace programs start by dereferencing the pointer at [gs:0]. The Process keeps a master copy of the TLS segment that new threads should use, and when a new thread is created, they get a copy of it. It's basically whatever the PT_TLS program header in the ELF says.