From 1a2aad287f43f1081810772c9792eb2a20c07ed5 Mon Sep 17 00:00:00 2001 From: Brian Gianforcaro Date: Mon, 3 Jan 2022 03:29:58 -0800 Subject: [PATCH] AK: Disable Vector insert/empend/prepend + a append overload in Kernel We have whittled away at the usages of these AK::Vector APIs in the Kernel. This change disables them from being visible when building the Kernel to make sure no new usages get added. --- AK/Vector.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/AK/Vector.h b/AK/Vector.h index 327be79be8..d04b34f83d 100644 --- a/AK/Vector.h +++ b/AK/Vector.h @@ -202,6 +202,8 @@ public: return false; } +#ifndef KERNEL + template void insert(size_t index, U&& value) requires(CanBePlacedInsideVector) { @@ -224,6 +226,8 @@ public: MUST(try_extend(other)); } +#endif + ALWAYS_INLINE void append(T&& value) { if constexpr (contains_reference) @@ -237,10 +241,12 @@ public: MUST(try_append(T(value))); } +#ifndef KERNEL void append(StorageType const* values, size_t count) { MUST(try_append(values, count)); } +#endif template ALWAYS_INLINE void unchecked_append(U&& value) requires(CanBePlacedInsideVector) @@ -262,6 +268,7 @@ public: m_size += count; } +#ifndef KERNEL template void empend(Args&&... args) requires(!contains_reference) { @@ -284,6 +291,8 @@ public: MUST(try_prepend(values, count)); } +#endif + // FIXME: What about assigning from a vector with lower inline capacity? Vector& operator=(Vector&& other) {