Commit Graph

14 Commits

Author SHA1 Message Date
Andreas Kling
7248c34e35 AK: SinglyLinkedList::size_slow() should return size_t 2019-12-09 17:51:21 +01:00
Andreas Kling
567551bc12 AK: Add some missing includes in SinglyLinkedList. 2019-07-08 14:06:22 +02:00
Andreas Kling
6e95b11395 AK: Allow HashMap to be used with non-default-constructible values.
Solve this by adding find() overloads to HashTable and SinglyLinkedList
that take a templated functor for comparing the values.

This allows HashMap to call HashTable::find() without having to create
a temporary Entry for use as the table key. :^)
2019-06-29 21:09:40 +02:00
Andreas Kling
d5bb98acbc AK: Defer to Traits<T> for equality comparison in container templates.
This is prep work for supporting HashMap with NonnullRefPtr<T> as values.
It's currently not possible because many HashTable functions require being
able to default-construct the value type.
2019-06-29 19:14:03 +02:00
Andreas Kling
2282e89d3f AK: Use a SinglyLinkedList<T> as HashTable's bucket chain storage.
We were using a DoublyLinkedList<T> simply because it supported remove().
This patch consolidates the SinglyLinkedList iterators and adds remove().
2019-06-27 16:36:31 +02:00
Andreas Kling
c699d9d79d AK: Add a simple Queue<T> class.
The underlying data structure is a singly-linked list of Vector<T>.
We never shift any of the vector contents around, but we batch the memory
allocations into 1000-element segments.
2019-06-15 10:35:35 +02:00
Robin Burchell
0dc9af5f7e Add clang-format file
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-05-28 17:31:20 +02:00
Andreas Kling
60db082fdd AK: Fix node leak in SinglyLinkedList::take_first(). 2019-03-13 13:11:23 +01:00
Andreas Kling
35098cbde1 Kernel: Add a NetworkTask and a received network packet queue.
It will be easier to deal with incoming packets in a separate task.
2019-03-11 12:43:45 +01:00
Andreas Kling
ffab6897aa Big, possibly complete sweep of naming changes. 2019-01-31 17:31:23 +01:00
Andreas Kling
b75ee4aacb Coding style fixes in AK. 2019-01-19 22:53:05 +01:00
Andreas Kling
ec1c487dcd Yet another pass of style fixes. 2018-12-21 02:10:45 +01:00
Andreas Kling
b7efd92937 Make SinglyLinkedList destruction actually work. 2018-10-13 14:29:00 +02:00
Andreas Kling
5a30055157 Import all this stuff into a single repo called Serenity. 2018-10-10 11:53:07 +02:00