summaryrefslogtreecommitdiff
path: root/AK/FixedArray.h
AgeCommit message (Collapse)Author
2023-02-08Everywhere: Use ReadonlySpan<T> instead of Span<T const>MacDue
2023-01-28AK: Remove `try_` prefix from FixedArray creation functionsLinus 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-08-27AK: Make empty FixedArray smallerAndreas Kling
Move the FixedArray's size field into the heap-allocated storage. This makes zero-sized FixedArrays take up 8 bytes instead of 16.
2022-07-22AK: Add FixedArray::fill_withkleines Filmröllchen
This is a memset-like utility method.
2022-07-22AK: Remove FixedArray::must_create_but_fixme_should_propagate_errorskleines Filmröllchen
Nobody was using this anymore.
2022-04-01Everywhere: Run clang-formatIdan Horowitz
2022-02-27AK: Add at() indexing methods to FixedArraykleines Filmröllchen
2022-02-27AK: Allow creating a FixedArray from an initializer listkleines Filmröllchen
2022-02-27AK: Add FixedArray::is_empty()kleines Filmröllchen
This also exists on Vector, and although it's less needed here, it's perfectly reasonable to have.
2022-01-15AK: Add a constructor from Span for FixedArraycreator1creeper1
This is particularly useful in the Kernel, where the physical pages of a VMObject are stored as a FixedArray but often passed around as a Span from which a new FixedArray should be cloned.
2022-01-15AK: Add a constructor from C-style arrays for FixedArraycreator1creeper1
We really want to be able to construct FixedArray from a list of non-copyable but movable objects. This constructor is useful for such things.
2022-01-13AK: Explain why FixedArray has no move assignmentkleines Filmröllchen
2022-01-13AK: Remove clear() from FixedArray and fixate its allocation guaranteeskleines Filmröllchen
FixedArray always *almost* had the following allocation guarantees: There is (possibly) one allocation in the constructor and one (or more) deallocation(s) in the destructor. No other operation allocates or deallocates. With this removal of the public clear() method, which nobody except the test used anyways, those guarantees are now completely true and furthermore fixated with an explanatory comment.
2022-01-08AK: Reorder functions in FixedArray so that mutable comes before constcreator1creeper1
2022-01-08AK: Reorder access in FixedArray so that m_size comes before m_elementscreator1creeper1
2022-01-08AK+Everywhere: Make FixedArray OOM-safecreator1creeper1
FixedArray now doesn't expose any infallible constructors anymore. Rather, it exposes fallible methods. Therefore, it can be used for OOM-safe code. This commit also converts the rest of the system to use the new API. However, as an example, VMObject can't take advantage of this yet, as we would have to endow VMObject with a fallible static construction method, which would require a very fundamental change to VMObject's whole inheritance hierarchy.
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-08-08AK: Use kmalloc_array() where appropriateAndreas Kling
2021-07-11AK: Add FixedArray::span()Andreas Kling
2021-07-11AK: Bring back FixedArray<T>Andreas Kling
Let's bring this class back, but without the confusing resize() API. A FixedArray<T> is simply a fixed-size array of T. The size is provided at run-time, unlike Array<T> where the size is provided at compile-time.
2020-09-08AK: Remove FixedArray class.asynts
2020-09-08AK: Add generic SimpleIterator class to replace VectorIterator.asynts
2020-08-30AK: Fix FixedArray zero bytes allocationsTom
2020-08-15AK: Add bytes() method to FixedArray.asynts
2020-02-18Kernel: Use a FixedArray for a process's extra GIDsAndreas Kling
There's not really enough of these to justify using a HashTable.
2020-01-31AK: Add FixedArray::data()William McPherson
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.
2020-01-07AK: Add assertions to FixedArray::operator[]Andreas Kling
Let's catch ourselves if we ever index out of bounds into one of these.
2019-08-07AK: Add a FixedArray<T> containerAndreas Kling
This is a simple array wrapper that knows its size. It has begin/end so you can use range-for. It also has a resize() that reallocates.