summaryrefslogtreecommitdiff
path: root/AK/CircularQueue.h
AgeCommit message (Collapse)Author
2023-01-14AK: Remove `CircularDuplexStream`Tim Schumacher
2022-12-03Everywhere: Run clang-formatLinus Groh
2022-11-26AK: Make it possible to not `using` AK classes into the global namespaceAndreas Kling
This patch adds the `USING_AK_GLOBALLY` macro which is enabled by default, but can be overridden by build flags. This is a step towards integrating Jakt and AK types.
2022-04-03AK: Add non-const iterator for CircularQueuekleines Filmröllchen
2022-04-01Everywhere: Run clang-formatIdan Horowitz
2021-11-14AK: Resolve clang-tidy readability-bool-conversion warningsAndrew Kaster
... In files included by Kernel/Process.cpp and Kernel/Thread.cpp
2021-10-08AK: Calculate CircularQueue::end() correctly (for real this time)Peter Elliott
Both my approach and the previous approach were wrong for different cases. I've changed the Iterators index from storage-relative to queue-relative, and it's much simpler and more obviously correct. fixes #10383
2021-10-06AK: Calculate CircularQueue::end() correctlyPeter Elliott
Previously end() was only correct when m_head == 0.
2021-09-16AK: Use default constructor/destructor instead of declaring an empty oneBrian Gianforcaro
Default implementations allow for more optimizations. See: https://pvs-studio.com/en/docs/warnings/v832/
2021-04-22Everything: Move to SPDX license identifiers in all files.Brian Gianforcaro
SPDX License Identifiers are a more compact / standardized way of representing file license information. See: https://spdx.dev/resources/use/#identifiers This was done with the `ambr` search and replace tool. ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-02-23Everywhere: Rename ASSERT => VERIFYAndreas Kling
(...and ASSERT_NOT_REACHED => VERIFY_NOT_REACHED) Since all of these checks are done in release builds as well, let's rename them to VERIFY to prevent confusion, as everyone is used to assertions being compiled out in release. We can introduce a new ASSERT macro that is specifically for debug checks, but I'm doing this wholesale conversion first since we've accumulated thousands of these already, and it's not immediately obvious which ones are suitable for ASSERT.
2021-01-31CircularQueue: Correctly pass args to enqueueLenny Maiorani
Problem: - Using regular functions rather than function templates results in the arguments not being deduced. This then requires the same function to be written multiple times and for `move` to be used rather than `forward`. Solution: - Collapse multiple function overloads to a single function template with a deduced argument. This allows the argument to be a forwarding reference and bind to either an l-value or r-value and forward the value.
2020-08-26AK: Add CircularDuplexStream class.asynts
2020-02-26CircularQueue: Move construct a T object instead of copy constructing ithowar6hill
2020-02-20AK: Use size_t for CircularQueue and CircularDequeAndreas Kling
2020-02-16AK: Add missing include in CircularQueue.hAndreas Kling
2020-01-18Meta: Add license header to source filesAndreas Kling
As suggested by Joshua, this commit adds the 2-clause BSD license as a comment block to the top of every source file. For the first pass, I've just added myself for simplicity. I encourage everyone to add themselves as copyright holders of any file they've added or modified in some significant way. If I've added myself in error somewhere, feel free to replace it with the appropriate copyright holder instead. Going forward, all new source files should include a license header.
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-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-05-28Add clang-format fileRobin Burchell
Also run it across the whole tree to get everything using the One True Style. We don't yet run this in an automated fashion as it's a little slow, but there is a snippet to do so in makeall.sh.
2019-04-20Snake: Clear the movement queue on game reset.Andreas Kling
2019-04-20Snake: Use a queue for the movement inputs.Andreas Kling
This makes it a lot less finicky to make rapid moves like staircasing and sudden turns.
2019-04-14WindowServer: Move the CPU monitor thingy to its own class.Andreas Kling
2019-03-27WindowServer: Move the CPU usage graph updates to a secondary thread.Andreas Kling
This avoids blocking the main thread on filesystem access, which created noticeable stutters during compilation.
2019-03-15AK: Add CircularQueue::at().Andreas Kling
2019-02-26WindowServer: Add a simple CPU usage graph to the global menu bar.Andreas Kling
This is pretty cute and helps me spot when something's chewing up CPU.
2019-01-28Expose the kernel log buffer through /proc/dmesg.Andreas Kling
Also add a /bin/dmesg program for convenience.
2018-12-03More coding style changes.Andreas Kling
2018-11-12Add primitive FIFO and hook it up to sys$pipe().Andreas Kling
It's now possible to do this in bash: cat kernel.map | fgrep List This is very cool! :^)
2018-10-23Lots of hacking:Andreas Kling
- Turn Keyboard into a CharacterDevice (85,1) at /dev/keyboard. - Implement MM::unmapRegionsForTask() and MM::unmapRegion() - Save SS correctly on interrupt. - Add a simple Spawn syscall for launching another process. - Move a bunch of IO syscall debug output behind DEBUG_IO. - Have ASSERT do a "cli" immediately when failing. This makes the output look proper every time. - Implement a bunch of syscalls in LibC. - Add a simple shell ("sh"). All it can do now is read a line of text from /dev/keyboard and then try launching the specified executable by calling spawn(). There are definitely bugs in here, but we're moving on forward.
2018-10-22Add a CircularQueue template class to AK.Andreas Kling